From 5c6798a64703be8eeb55b875c76c8f5436a53129 Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Thu, 27 Nov 2025 17:24:48 +0100 Subject: [PATCH 01/51] fixed errors --- PyroFetes/DTO/Supplier/Response/GetSupplierDto.cs | 3 +++ PyroFetes/Endpoints/Users/CreateUserEndpoint.cs | 9 +++++++++ PyroFetes/Endpoints/Users/UpdateUserEndpoint.cs | 2 +- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/PyroFetes/DTO/Supplier/Response/GetSupplierDto.cs b/PyroFetes/DTO/Supplier/Response/GetSupplierDto.cs index 1fc9a60..dbd2ffb 100644 --- a/PyroFetes/DTO/Supplier/Response/GetSupplierDto.cs +++ b/PyroFetes/DTO/Supplier/Response/GetSupplierDto.cs @@ -1,3 +1,5 @@ +using PyroFetes.DTO.Product.Response; + namespace PyroFetes.DTO.Supplier.Response; public class GetSupplierDto @@ -10,4 +12,5 @@ public class GetSupplierDto public string? ZipCode { get; set; } public string? City { get; set; } public int DeliveryDelay { get; set; } + public List? Products { get; set; } } \ No newline at end of file diff --git a/PyroFetes/Endpoints/Users/CreateUserEndpoint.cs b/PyroFetes/Endpoints/Users/CreateUserEndpoint.cs index 1a014d9..73c557b 100644 --- a/PyroFetes/Endpoints/Users/CreateUserEndpoint.cs +++ b/PyroFetes/Endpoints/Users/CreateUserEndpoint.cs @@ -4,6 +4,7 @@ using PyroFetes.DTO.User.Request; using PyroFetes.DTO.User.Response; using PyroFetes.Models; using PyroFetes.Repositories; +using PyroFetes.Specifications.Users; namespace PyroFetes.Endpoints.Users; @@ -19,6 +20,14 @@ public class CreateUserEndpoint( public override async Task HandleAsync(CreateUserDto req, CancellationToken ct) { + User? ckeckName = await usersRepository.FirstOrDefaultAsync(new GetUserByNameSpec(req.Name!), ct); + + if (ckeckName != null) + { + await Send.StringAsync("Ce nom d'utilisateur existe déjà.",409, cancellation: ct); + return; + } + string? salt = new Password().IncludeLowercase().IncludeUppercase().IncludeNumeric().LengthRequired(24).Next(); User user = new User() diff --git a/PyroFetes/Endpoints/Users/UpdateUserEndpoint.cs b/PyroFetes/Endpoints/Users/UpdateUserEndpoint.cs index b50439d..46eac23 100644 --- a/PyroFetes/Endpoints/Users/UpdateUserEndpoint.cs +++ b/PyroFetes/Endpoints/Users/UpdateUserEndpoint.cs @@ -30,7 +30,7 @@ public class UpdateUserEndpoint( return; } - if (ckeckName != null) + if (ckeckName != null && ckeckName.Id != user.Id) { await Send.StringAsync("Ce nom d'utilisateur existe déjà.",409, cancellation: ct); return; From 2a439ccbb5a19060298a5a9952437dc58d8fb422 Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Fri, 28 Nov 2025 09:51:12 +0100 Subject: [PATCH 02/51] added mapper --- PyroFetes/MappingProfiles/EntityToDtoMappings.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/PyroFetes/MappingProfiles/EntityToDtoMappings.cs b/PyroFetes/MappingProfiles/EntityToDtoMappings.cs index 0fbbffe..aebafa9 100644 --- a/PyroFetes/MappingProfiles/EntityToDtoMappings.cs +++ b/PyroFetes/MappingProfiles/EntityToDtoMappings.cs @@ -9,6 +9,7 @@ using PyroFetes.DTO.PurchaseProduct.Response; using PyroFetes.DTO.Quotation.Response; using PyroFetes.DTO.QuotationProduct.Response; using PyroFetes.DTO.SettingDTO.Response; +using PyroFetes.DTO.Supplier.Response; using PyroFetes.DTO.User.Response; using PyroFetes.DTO.WareHouseProduct.Response; using PyroFetes.Models; @@ -21,6 +22,8 @@ public class EntityToDtoMappings : Profile { CreateMap(); + CreateMap(); + CreateMap(); CreateMap(); From efa7a0be6f3c84988046f6a276ab425717c56575 Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Sat, 29 Nov 2025 21:58:20 +0100 Subject: [PATCH 03/51] added DeleteProductEndpoint.cs --- .../Products/DeleteProductEndpoint.cs | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 PyroFetes/Endpoints/Products/DeleteProductEndpoint.cs diff --git a/PyroFetes/Endpoints/Products/DeleteProductEndpoint.cs b/PyroFetes/Endpoints/Products/DeleteProductEndpoint.cs new file mode 100644 index 0000000..1e48163 --- /dev/null +++ b/PyroFetes/Endpoints/Products/DeleteProductEndpoint.cs @@ -0,0 +1,38 @@ +using FastEndpoints; +using PyroFetes.Endpoints.Deliverers; +using PyroFetes.Models; +using PyroFetes.Repositories; +using PyroFetes.Specifications.Deliverers; +using PyroFetes.Specifications.Products; + +namespace PyroFetes.Endpoints.Products; + +public class DeleteProductsRequest +{ + public int ProductId { get; set; } +} +public class DeleteProductEndpoint(ProductsRepository productsRepository) : Endpoint +{ + public override void Configure() + { + Delete("/products/{@id}", x=>new {x.ProductId}); + AllowAnonymous(); + + } + + public override async Task HandleAsync(DeleteProductsRequest req, CancellationToken ct) + { + Product? product = await productsRepository.FirstOrDefaultAsync(new GetProductByIdSpec(req.ProductId), ct); + + if (product == null) + { + await Send.NotFoundAsync(ct); + return; + } + + await productsRepository.DeleteAsync(product, ct); + + await Send.OkAsync(ct); + } + +} \ No newline at end of file From 9e6834754f50cd9710999f3b18c1a999b39c76c6 Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Sun, 30 Nov 2025 14:23:30 +0100 Subject: [PATCH 04/51] added DeleteDeliveryNoteEndpoint.cs --- .../DeleteDeliveryNoteEndpoint.cs | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 PyroFetes/Endpoints/DeliveryNotes/DeleteDeliveryNoteEndpoint.cs diff --git a/PyroFetes/Endpoints/DeliveryNotes/DeleteDeliveryNoteEndpoint.cs b/PyroFetes/Endpoints/DeliveryNotes/DeleteDeliveryNoteEndpoint.cs new file mode 100644 index 0000000..4fe7644 --- /dev/null +++ b/PyroFetes/Endpoints/DeliveryNotes/DeleteDeliveryNoteEndpoint.cs @@ -0,0 +1,38 @@ +using FastEndpoints; +using PyroFetes.Endpoints.Quotations; +using PyroFetes.Models; +using PyroFetes.Repositories; +using PyroFetes.Specifications.DeliveryNotes; +using PyroFetes.Specifications.Quotations; + +namespace PyroFetes.Endpoints.DeliveryNotes; + +public class DeleteDeliveryNoteRequest +{ + public int Id { get; set; } +} + +public class DeleteDeliveryNoteEndpoint( + DeliveryNotesRepository deliveryNotesRepository) : Endpoint +{ + public override void Configure() + { + Delete("/deliveryNotes/{@Id}", x => new {x.Id}); + AllowAnonymous(); + } + + public override async Task HandleAsync(DeleteDeliveryNoteRequest req, CancellationToken ct) + { + DeliveryNote? deliveryNote = await deliveryNotesRepository.FirstOrDefaultAsync(new GetDeliveryNoteByIdSpec(req.Id), ct); + + if (deliveryNote == null) + { + await Send.NotFoundAsync(ct); + return; + } + + await deliveryNotesRepository.DeleteAsync(deliveryNote, ct); + + await Send.NoContentAsync(ct); + } +} \ No newline at end of file From db9219e80fe8237176be60f589f6336a4c9f256e Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Sun, 30 Nov 2025 14:50:21 +0100 Subject: [PATCH 05/51] fix error in PatchRealDeliveryDateEndpoint.cs --- .../DeliveryNotes/PatchRealDeliveryDateEndpoint.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/PyroFetes/Endpoints/DeliveryNotes/PatchRealDeliveryDateEndpoint.cs b/PyroFetes/Endpoints/DeliveryNotes/PatchRealDeliveryDateEndpoint.cs index bad22b7..99c35c1 100644 --- a/PyroFetes/Endpoints/DeliveryNotes/PatchRealDeliveryDateEndpoint.cs +++ b/PyroFetes/Endpoints/DeliveryNotes/PatchRealDeliveryDateEndpoint.cs @@ -30,6 +30,12 @@ public class PatchRealDeliveryDateEndpoint( return; } + if (deliveryNoteToPath.RealDeliveryDate != null) + { + await Send.StringAsync("Impossible de modifier la date.", 400); + return; + } + deliveryNoteToPath.RealDeliveryDate = req.RealDeliveryDate; await deliveryNotesRepository.UpdateAsync(deliveryNoteToPath, ct); From 8a04adeec325654de4eed2a00249988782a63190 Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Sun, 30 Nov 2025 15:35:08 +0100 Subject: [PATCH 06/51] updated GetSupplierDto.cs --- PyroFetes/DTO/Supplier/Response/GetSupplierDto.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/PyroFetes/DTO/Supplier/Response/GetSupplierDto.cs b/PyroFetes/DTO/Supplier/Response/GetSupplierDto.cs index dbd2ffb..2edbe93 100644 --- a/PyroFetes/DTO/Supplier/Response/GetSupplierDto.cs +++ b/PyroFetes/DTO/Supplier/Response/GetSupplierDto.cs @@ -1,3 +1,4 @@ +using PyroFetes.DTO.Price.Response; using PyroFetes.DTO.Product.Response; namespace PyroFetes.DTO.Supplier.Response; @@ -13,4 +14,5 @@ public class GetSupplierDto public string? City { get; set; } public int DeliveryDelay { get; set; } public List? Products { get; set; } + public List? Prices { get; set; } } \ No newline at end of file From 4a82c511336ea5266ce5d922388e708ffd972d1d Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Sun, 30 Nov 2025 15:43:59 +0100 Subject: [PATCH 07/51] fixed errors --- PyroFetes/DTO/Price/Response/GetPriceDto.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/PyroFetes/DTO/Price/Response/GetPriceDto.cs b/PyroFetes/DTO/Price/Response/GetPriceDto.cs index a042cd2..fbd38a8 100644 --- a/PyroFetes/DTO/Price/Response/GetPriceDto.cs +++ b/PyroFetes/DTO/Price/Response/GetPriceDto.cs @@ -10,7 +10,7 @@ public class GetPriceDto public string? SupplierEmail { get; set; } public string? SupplierPhone { get; set; } public string? SupplierAddress { get; set; } - public int SupplierZipCode { get; set; } + public string? SupplierZipCode { get; set; } public string? SupplierCity { get; set; } public int SupplierDeliveryDelay { get; set; } @@ -18,8 +18,8 @@ public class GetPriceDto public string? ProductReferences { get; set; } public string? ProductName { get; set; } public decimal ProductDuration {get; set;} - public decimal ProductCaliber { get; set; } - public int ProductApprovalNumber { get; set; } + public int ProductCaliber { get; set; } + public string? ProductApprovalNumber { get; set; } public decimal ProductWeight { get; set; } public decimal ProductNec { get; set; } public string? ProductImage { get; set; } From d7096544102897fd81ff819386b5fd22f0382366 Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Sun, 30 Nov 2025 16:59:28 +0100 Subject: [PATCH 08/51] fix error in GetTotalQuantityEndpoint.cs --- .../WareHouseProducts/GetTotalQuantityEndpoint.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/PyroFetes/Endpoints/WareHouseProducts/GetTotalQuantityEndpoint.cs b/PyroFetes/Endpoints/WareHouseProducts/GetTotalQuantityEndpoint.cs index 6df7fd9..0101118 100644 --- a/PyroFetes/Endpoints/WareHouseProducts/GetTotalQuantityEndpoint.cs +++ b/PyroFetes/Endpoints/WareHouseProducts/GetTotalQuantityEndpoint.cs @@ -31,9 +31,10 @@ public class GetTotalQuantityEndpoint( return; } - int totalQuantity = - await warehouseProductsRepository.SumAsync(new GetProductTotalQuantitySpec(req.ProductId), - wp => wp.Quantity, ct); + int? totalQuantityNullable = await warehouseProductsRepository. + SumAsync(new GetProductTotalQuantitySpec(req.ProductId), wp => wp.Quantity, ct); + + int totalQuantity = totalQuantityNullable ?? 0; GetTotalQuantityDto responseDto = new() { From bee1cfb0e36c87ff9e8260ef75e9f99f224d051e Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Wed, 3 Dec 2025 17:00:02 +0100 Subject: [PATCH 09/51] added PDF generation for quotation --- .../Quotation/Request/GetQuotationPdfDto.cs | 6 + .../Quotations/GetQuotationPdfEndpoint.cs | 41 +++++ PyroFetes/Program.cs | 7 + PyroFetes/PyroFetes.csproj | 14 ++ PyroFetes/Services/Pdf/QuotationPdfService.cs | 143 ++++++++++++++++++ .../GetQuotationByIdWithProductsSpec.cs | 15 ++ PyroFetes/wwwroot/Images/logo.jpg | Bin 0 -> 47397 bytes PyroFetes/wwwroot/Images/signature.png | Bin 0 -> 10292 bytes 8 files changed, 226 insertions(+) create mode 100644 PyroFetes/DTO/Quotation/Request/GetQuotationPdfDto.cs create mode 100644 PyroFetes/Endpoints/Quotations/GetQuotationPdfEndpoint.cs create mode 100644 PyroFetes/Services/Pdf/QuotationPdfService.cs create mode 100644 PyroFetes/Specifications/Quotations/GetQuotationByIdWithProductsSpec.cs create mode 100644 PyroFetes/wwwroot/Images/logo.jpg create mode 100644 PyroFetes/wwwroot/Images/signature.png diff --git a/PyroFetes/DTO/Quotation/Request/GetQuotationPdfDto.cs b/PyroFetes/DTO/Quotation/Request/GetQuotationPdfDto.cs new file mode 100644 index 0000000..0c74cd7 --- /dev/null +++ b/PyroFetes/DTO/Quotation/Request/GetQuotationPdfDto.cs @@ -0,0 +1,6 @@ +namespace PyroFetes.DTO.Quotation.Request; + +public class GetQuotationPdfDto +{ + public int Id { get; set; } +} \ No newline at end of file diff --git a/PyroFetes/Endpoints/Quotations/GetQuotationPdfEndpoint.cs b/PyroFetes/Endpoints/Quotations/GetQuotationPdfEndpoint.cs new file mode 100644 index 0000000..d0d015a --- /dev/null +++ b/PyroFetes/Endpoints/Quotations/GetQuotationPdfEndpoint.cs @@ -0,0 +1,41 @@ +using FastEndpoints; +using PyroFetes.DTO.Quotation.Request; +using PyroFetes.Models; +using PyroFetes.Repositories; +using PyroFetes.Services.Pdf; +using PyroFetes.Specifications.Quotations; + +namespace PyroFetes.Endpoints.Quotations; + +public class GetQuotationPdfEndpoint( + QuotationsRepository quotationRepository, + QuotationProductsRepository quotationProductRepository, + IQuotationPdfService quotationPdfService) + : Endpoint +{ + public override void Configure() + { + Get("/quotations/{@Id}/pdf", x => new {x.Id}); + AllowAnonymous(); + } + + public override async Task HandleAsync(GetQuotationPdfDto req, CancellationToken ct) + { + Quotation? quotation = await quotationRepository + .FirstOrDefaultAsync(new GetQuotationByIdWithProductsSpec(req.Id), ct); + + if (quotation == null) + { + await Send.NotFoundAsync(ct); + return; + } + + var bytes = quotationPdfService.Generate(quotation, quotation.QuotationProducts!); + + await Send.BytesAsync( + bytes: bytes, + contentType: "application/pdf", + fileName: $"devis-{quotation.Id}.pdf", + cancellation: ct); + } +} \ No newline at end of file diff --git a/PyroFetes/Program.cs b/PyroFetes/Program.cs index e1a719b..9e62ec9 100644 --- a/PyroFetes/Program.cs +++ b/PyroFetes/Program.cs @@ -6,9 +6,14 @@ using FastEndpoints.Swagger; using FastEndpoints.Security; using PyroFetes.MappingProfiles; using PyroFetes.Repositories; +using PyroFetes.Services.Pdf; +using QuestPDF.Infrastructure; WebApplicationBuilder builder = WebApplication.CreateBuilder(args); +// Configurer la licence QuestPDF +QuestPDF.Settings.License = LicenseType.Community; + // On ajoute ici FastEndpoints, un framework REPR et Swagger aux services disponibles dans le projet builder.Services .AddAuthenticationJwtBearer(s => s.SigningKey = "ThisIsASuperSecretJwtKeyThatIsAtLeast32CharsLong") @@ -46,6 +51,8 @@ builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); +builder.Services.AddScoped(); + MapperConfiguration mappingConfig = new(mc => { mc.AddCollectionMappers(); diff --git a/PyroFetes/PyroFetes.csproj b/PyroFetes/PyroFetes.csproj index cd211f5..3e77db0 100644 --- a/PyroFetes/PyroFetes.csproj +++ b/PyroFetes/PyroFetes.csproj @@ -23,7 +23,21 @@ + + + <_ContentIncludedByDefault Remove="wwwroot\Images\logo.jpg" /> + + + + + PreserveNewest + + + PreserveNewest + + + diff --git a/PyroFetes/Services/Pdf/QuotationPdfService.cs b/PyroFetes/Services/Pdf/QuotationPdfService.cs new file mode 100644 index 0000000..4e3591d --- /dev/null +++ b/PyroFetes/Services/Pdf/QuotationPdfService.cs @@ -0,0 +1,143 @@ +using PyroFetes.Models; +using QuestPDF.Fluent; +using QuestPDF.Helpers; +using QuestPDF.Infrastructure; + +namespace PyroFetes.Services.Pdf; + +public interface IQuotationPdfService +{ + byte[] Generate(Quotation quotation, List lignes); +} + +public class QuotationPdfService : IQuotationPdfService +{ + public byte[] Generate(Quotation quotation, List lignes) + { + var logoPath = Path.Combine(AppContext.BaseDirectory, "wwwroot", "Images", "logo.jpg"); + var signaturePath = Path.Combine(AppContext.BaseDirectory, "wwwroot", "Images", "signature.png"); + int total = 0; + var document = Document.Create(container => + { + container.Page(page => + { + page.Size(PageSizes.A4); + page.Margin(30); + page.DefaultTextStyle(x => x.FontSize(11)); + + page.Header().Row(row => + { + // Client à gauche + row.RelativeItem().Column(col => + { + col.Item().Text(""); + col.Item().Text(""); + col.Item().Text(""); + col.Item().Text(""); + col.Item().Text("Client").SemiBold().FontSize(12); + col.Item().Text($"{quotation.Customer}"); + }); + + // Logo + société à droite + row.ConstantItem(200).Column(col => + { + col.Item().AlignRight().Height(70).Image(logoPath, ImageScaling.FitArea); + col.Item().Height(20); + col.Item().AlignRight().Text("Pyro-Fêtes").SemiBold(); + col.Item().Height(5); + col.Item().AlignRight().Text("24, rue La Fosse Mardeau\n41700 Le Controis-en-Sologne"); + col.Item().Height(5); + col.Item().AlignRight().Text("Téléphone: 02 54 78 77 66"); + col.Item().Height(5); + col.Item().AlignRight().Text("SIRET: 82031463100012"); + col.Item().Height(40); + }); + }); + + page.Content().Column(col => + { + // Titre + date + col.Item().Row(row => + { + row.RelativeItem().Text($"Devis n° {quotation.Id}") + .FontSize(16).SemiBold(); + + row.ConstantItem(200).AlignRight().Text( + $"Le {DateTime.Now:dd/MM/yyyy}"); + }); + col.Item().Height(20); + + col.Item().LineHorizontal(1); + + // Tableau des lignes + col.Item().Table(table => + { + table.ColumnsDefinition(columns => + { + columns.RelativeColumn(4); // Produit + columns.RelativeColumn(1); // Qté + columns.RelativeColumn(2); // PU + columns.RelativeColumn(2); // Total + }); + + // En-têtes + table.Header(header => + { + header.Cell().Element(CellHeader).Text("Produit"); + header.Cell().Element(CellHeader).AlignRight().Text("Qté"); + header.Cell().Element(CellHeader).AlignRight().Text("PU"); + header.Cell().Element(CellHeader).AlignRight().Text("Total"); + }); + + foreach (var l in lignes) + { + 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} €"); + + total = total + l.Quantity * l.Quantity; + } + + IContainer CellHeader(IContainer c) => + c.BorderBottom(1).PaddingVertical(5).DefaultTextStyle(x => x.SemiBold()); + + IContainer CellBody(IContainer c) => + c.PaddingVertical(2); + }); + + col.Item().LineHorizontal(1); + col.Item().Height(30); + + col.Item().Row(row => + { + // Colonne gauche : conditions de vente + row.RelativeItem().Column(left => + { + left.Item().Text("Conditions de vente") + .SemiBold().FontSize(12); + left.Item().Text(quotation.ConditionsSale) + .FontSize(9); + }); + + // Colonne droite : totaux + row.ConstantItem(180).Column(right => + { + right.Item().AlignRight().Text($"Total HT : {total:n2} €"); + right.Item().AlignRight().Text("Taxe : 20 %"); + right.Item().AlignRight().Text($"Total TTC : {(total * 1.2):n2} €"); + }); + }); + }); + + // Signature en bas à droite + page.Footer().AlignRight().Column(col => + { + col.Item().AlignRight().Height(100).Image(signaturePath, ImageScaling.FitArea); + }); + }); + }); + + return document.GeneratePdf(); + } +} diff --git a/PyroFetes/Specifications/Quotations/GetQuotationByIdWithProductsSpec.cs b/PyroFetes/Specifications/Quotations/GetQuotationByIdWithProductsSpec.cs new file mode 100644 index 0000000..3e8d724 --- /dev/null +++ b/PyroFetes/Specifications/Quotations/GetQuotationByIdWithProductsSpec.cs @@ -0,0 +1,15 @@ +using Ardalis.Specification; +using PyroFetes.Models; + +namespace PyroFetes.Specifications.Quotations; + +public class GetQuotationByIdWithProductsSpec : Specification +{ + public GetQuotationByIdWithProductsSpec(int quotationId) + { + Query + .Where(q => q.Id == quotationId) + .Include(q => q.QuotationProducts!) + .ThenInclude(qp => qp.Product); + } +} \ No newline at end of file diff --git a/PyroFetes/wwwroot/Images/logo.jpg b/PyroFetes/wwwroot/Images/logo.jpg new file mode 100644 index 0000000000000000000000000000000000000000..e459459759d1217e5d65d506dae8249f932963b1 GIT binary patch literal 47397 zcmdqI1yo#5w

_kl+r%HMlzsB)Ge4f@^o94FpJVcXxMaoW=>k-6b><+=2%QA@c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LWDaeX%r*h4HB?lVdNgx7C~;1cM5EA zvKEVhj5M0&#*Yb*Ac>@21OW>fKt%!pb@GIW&wLkI zVK@dXt{AF(C|cq2S%`BF$|py(G4$}5LFYgWO6HsX2hbEi%ce#o265Ve#25%Lo^>F_ zA(_tYB@7cjG!lmwqlDg6FgCCWC>5~*V<_`rEcc-_Dno#o=Rhh5ys1~|+`X1CqY1(e zVmwg4;ar1N!hV*(K*0Rml#D0RFcK(5ufmw2ronlFk!S!39!TH`i%-W$kl-*9km9mJ0#g0~5@YCx4IKgqE$~Bz0SufYRDEuM!LsteBM&?tP?-;)h~b!4 zU5TWF_IlX;)#)n0!b&33}GZ>Ai?Y*0*MtS1#4l5 zVp1Lei3gBOuLTl0Ai+8%6a|1_05c8P%tn~m3Nv9~hYDsgjFZKR!GodaYg5QiKi&{6=+CgC4z{NZ|rMgj$Zz~cn@-Mhec;ASpDGohOH zA7?Odz5|BmP`95J0lFZFo3Q7{40*63H1tPe&`KZ69-{$AOlt!TT(*b^9^nvyI|}r| zi-V7owPK8$04S{gA1+~-&x24?19x-0eSq}?c#7IJH8pjxREda_eUN$ZB$W8jpOqis j{QvTsw*Q+S*!_{Q-FIXoPSo)mz( Date: Wed, 3 Dec 2025 17:41:19 +0100 Subject: [PATCH 10/51] added pdf generation for all orders --- .../Request/GetDeliveryNotePdfDto.cs | 6 + .../Request/GetPurchaseOrderPdfDto.cs | 6 + .../GetDeliveryNotePdfEndpoint.cs | 41 +++++ .../GetPurchaseOrderPdfEndpoint.cs | 39 +++++ .../Quotations/GetQuotationPdfEndpoint.cs | 1 - PyroFetes/Program.cs | 2 + .../Services/Pdf/DeliveryNotePdfService.cs | 133 ++++++++++++++++ .../Services/Pdf/PurchaseOrderPdfService.cs | 146 ++++++++++++++++++ .../GetDeliveryNoteByIdWithProductsSpec.cs | 15 ++ .../GetPurchaseOrderByIdWithProductsSpec.cs | 15 ++ 10 files changed, 403 insertions(+), 1 deletion(-) create mode 100644 PyroFetes/DTO/DeliveryNote/Request/GetDeliveryNotePdfDto.cs create mode 100644 PyroFetes/DTO/PurchaseOrder/Request/GetPurchaseOrderPdfDto.cs create mode 100644 PyroFetes/Endpoints/DeliveryNotes/GetDeliveryNotePdfEndpoint.cs create mode 100644 PyroFetes/Endpoints/PurchaseOrders/GetPurchaseOrderPdfEndpoint.cs create mode 100644 PyroFetes/Services/Pdf/DeliveryNotePdfService.cs create mode 100644 PyroFetes/Services/Pdf/PurchaseOrderPdfService.cs create mode 100644 PyroFetes/Specifications/DeliveryNotes/GetDeliveryNoteByIdWithProductsSpec.cs create mode 100644 PyroFetes/Specifications/PurchaseOrders/GetPurchaseOrderByIdWithProductsSpec.cs diff --git a/PyroFetes/DTO/DeliveryNote/Request/GetDeliveryNotePdfDto.cs b/PyroFetes/DTO/DeliveryNote/Request/GetDeliveryNotePdfDto.cs new file mode 100644 index 0000000..080ef0d --- /dev/null +++ b/PyroFetes/DTO/DeliveryNote/Request/GetDeliveryNotePdfDto.cs @@ -0,0 +1,6 @@ +namespace PyroFetes.DTO.DeliveryNote.Request; + +public class GetDeliveryNotePdfDto +{ + public int Id { get; set; } +} \ No newline at end of file diff --git a/PyroFetes/DTO/PurchaseOrder/Request/GetPurchaseOrderPdfDto.cs b/PyroFetes/DTO/PurchaseOrder/Request/GetPurchaseOrderPdfDto.cs new file mode 100644 index 0000000..5ed195d --- /dev/null +++ b/PyroFetes/DTO/PurchaseOrder/Request/GetPurchaseOrderPdfDto.cs @@ -0,0 +1,6 @@ +namespace PyroFetes.DTO.PurchaseOrder.Request; + +public class GetPurchaseOrderPdfDto +{ + public int Id { get; set; } +} \ No newline at end of file diff --git a/PyroFetes/Endpoints/DeliveryNotes/GetDeliveryNotePdfEndpoint.cs b/PyroFetes/Endpoints/DeliveryNotes/GetDeliveryNotePdfEndpoint.cs new file mode 100644 index 0000000..e9dd25a --- /dev/null +++ b/PyroFetes/Endpoints/DeliveryNotes/GetDeliveryNotePdfEndpoint.cs @@ -0,0 +1,41 @@ +using FastEndpoints; +using PyroFetes.DTO.DeliveryNote.Request; +using PyroFetes.Models; +using PyroFetes.Repositories; +using PyroFetes.Services.Pdf; +using PyroFetes.Specifications.DeliveryNotes; +using PyroFetes.Specifications.Quotations; + +namespace PyroFetes.Endpoints.DeliveryNotes; + +public class GetDeliveryNotePdfEndpoint( + DeliveryNotesRepository deliveryNotesRepository, + IDeliveryNotePdfService deliveryNotePdfService) + : Endpoint +{ + public override void Configure() + { + Get("/deliveryNotes/{@Id}/pdf", x => new {x.Id}); + AllowAnonymous(); + } + + public override async Task HandleAsync(GetDeliveryNotePdfDto req, CancellationToken ct) + { + DeliveryNote? deliveryNote = await deliveryNotesRepository + .FirstOrDefaultAsync(new GetDeliveryNoteByIdWithProductsSpec(req.Id), ct); + + if (deliveryNote == null) + { + await Send.NotFoundAsync(ct); + return; + } + + var bytes = deliveryNotePdfService.Generate(deliveryNote, deliveryNote.ProductDeliveries!); + + await Send.BytesAsync( + bytes: bytes, + contentType: "application/pdf", + fileName: $"bon-de-livraison-{deliveryNote.Id}.pdf", + cancellation: ct); + } +} \ No newline at end of file diff --git a/PyroFetes/Endpoints/PurchaseOrders/GetPurchaseOrderPdfEndpoint.cs b/PyroFetes/Endpoints/PurchaseOrders/GetPurchaseOrderPdfEndpoint.cs new file mode 100644 index 0000000..a0f48df --- /dev/null +++ b/PyroFetes/Endpoints/PurchaseOrders/GetPurchaseOrderPdfEndpoint.cs @@ -0,0 +1,39 @@ +using FastEndpoints; +using PyroFetes.DTO.PurchaseOrder.Request; +using PyroFetes.Models; +using PyroFetes.Repositories; +using PyroFetes.Services.Pdf; +using PyroFetes.Specifications.PurchaseOrders; +namespace PyroFetes.Endpoints.PurchaseOrders; + +public class GetPurchaseOrderPdfEndpoint( + PurchaseOrdersRepository purchaseOrdersRepository, + IPurchaseOrderPdfService purchaseOrderPdfService) + : Endpoint +{ + public override void Configure() + { + Get("/purchaseOrders/{@Id}/pdf", x => new {x.Id}); + AllowAnonymous(); + } + + public override async Task HandleAsync(GetPurchaseOrderPdfDto req, CancellationToken ct) + { + PurchaseOrder? purchaseOrder = await purchaseOrdersRepository + .FirstOrDefaultAsync(new GetPurchaseOrderByIdWithProductsSpec(req.Id), ct); + + if (purchaseOrder == null) + { + await Send.NotFoundAsync(ct); + return; + } + + var bytes = purchaseOrderPdfService.Generate(purchaseOrder, purchaseOrder.PurchaseProducts!); + + await Send.BytesAsync( + bytes: bytes, + contentType: "application/pdf", + fileName: $"bon-de-commande-{purchaseOrder.Id}.pdf", + cancellation: ct); + } +} \ No newline at end of file diff --git a/PyroFetes/Endpoints/Quotations/GetQuotationPdfEndpoint.cs b/PyroFetes/Endpoints/Quotations/GetQuotationPdfEndpoint.cs index d0d015a..1b425f9 100644 --- a/PyroFetes/Endpoints/Quotations/GetQuotationPdfEndpoint.cs +++ b/PyroFetes/Endpoints/Quotations/GetQuotationPdfEndpoint.cs @@ -9,7 +9,6 @@ namespace PyroFetes.Endpoints.Quotations; public class GetQuotationPdfEndpoint( QuotationsRepository quotationRepository, - QuotationProductsRepository quotationProductRepository, IQuotationPdfService quotationPdfService) : Endpoint { diff --git a/PyroFetes/Program.cs b/PyroFetes/Program.cs index 9e62ec9..e7c8595 100644 --- a/PyroFetes/Program.cs +++ b/PyroFetes/Program.cs @@ -51,6 +51,8 @@ builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); +builder.Services.AddScoped(); +builder.Services.AddScoped(); builder.Services.AddScoped(); MapperConfiguration mappingConfig = new(mc => diff --git a/PyroFetes/Services/Pdf/DeliveryNotePdfService.cs b/PyroFetes/Services/Pdf/DeliveryNotePdfService.cs new file mode 100644 index 0000000..e084ec2 --- /dev/null +++ b/PyroFetes/Services/Pdf/DeliveryNotePdfService.cs @@ -0,0 +1,133 @@ +using PyroFetes.Models; +using QuestPDF.Fluent; +using QuestPDF.Helpers; +using QuestPDF.Infrastructure; + +namespace PyroFetes.Services.Pdf; + +public interface IDeliveryNotePdfService +{ + byte[] Generate(DeliveryNote deliveryNote, List lignes); +} + +public class DeliveryNotePdfService : IDeliveryNotePdfService +{ + public byte[] Generate(DeliveryNote deliveryNote, List lignes) + { + var logoPath = Path.Combine(AppContext.BaseDirectory, "wwwroot", "Images", "logo.jpg"); + var signaturePath = Path.Combine(AppContext.BaseDirectory, "wwwroot", "Images", "signature.png"); + int total = 0; + int totalQuantity = 0; + var document = Document.Create(container => + { + container.Page(page => + { + page.Size(PageSizes.A4); + page.Margin(30); + page.DefaultTextStyle(x => x.FontSize(11)); + + page.Header().Row(row => + { + // Client à gauche + row.RelativeItem().Column(col => + { + col.Item().Text(""); + col.Item().Text(""); + col.Item().Text(""); + col.Item().Text(""); + col.Item().Text("Transporteur").SemiBold().FontSize(12); + col.Item().Text($"{deliveryNote.Deliverer?.Transporter}"); + col.Item().Height(5); + col.Item().AlignLeft().Text($"Expédiée le {deliveryNote.ExpeditionDate}"); + col.Item().Height(5); + col.Item().AlignLeft().Text($"Estimée au {deliveryNote.EstimateDeliveryDate}"); + col.Item().Height(5); + col.Item().AlignLeft().Text($"Reçu le {deliveryNote.RealDeliveryDate}"); + }); + + // Logo + société à droite + row.ConstantItem(200).Column(col => + { + col.Item().AlignRight().Height(70).Image(logoPath, ImageScaling.FitArea); + col.Item().Height(20); + col.Item().AlignRight().Text("Pyro-Fêtes").SemiBold(); + col.Item().Height(5); + col.Item().AlignRight().Text("24, rue La Fosse Mardeau\n41700 Le Controis-en-Sologne"); + col.Item().Height(5); + col.Item().AlignRight().Text("Téléphone: 02 54 78 77 66"); + col.Item().Height(5); + col.Item().AlignRight().Text("SIRET: 82031463100012"); + col.Item().Height(40); + }); + }); + + page.Content().Column(col => + { + // Titre + date + col.Item().Row(row => + { + row.RelativeItem().Text($"Bon de livraison n° {deliveryNote.TrackingNumber}") + .FontSize(16).SemiBold(); + }); + col.Item().Height(20); + + col.Item().LineHorizontal(1); + + // Tableau des lignes + col.Item().Table(table => + { + table.ColumnsDefinition(columns => + { + columns.RelativeColumn(4); // Produit + columns.RelativeColumn(2); // Qté + columns.RelativeColumn(2); // PU + columns.RelativeColumn(2); // Total + }); + + // En-têtes + table.Header(header => + { + header.Cell().Element(CellHeader).Text("Produit"); + header.Cell().Element(CellHeader).AlignRight().Text("Qté"); + header.Cell().Element(CellHeader).AlignRight().Text("PU"); + header.Cell().Element(CellHeader).AlignRight().Text("Total"); + }); + + foreach (var l in lignes) + { + 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} €"); + + totalQuantity += l.Quantity; + total += l.Quantity * l.Quantity; + } + + IContainer CellHeader(IContainer c) => + c.BorderBottom(1).PaddingVertical(5).DefaultTextStyle(x => x.SemiBold()); + + IContainer CellBody(IContainer c) => + c.PaddingVertical(2); + }); + + col.Item().LineHorizontal(1); + col.Item().Height(30); + + col.Item().AlignRight().Text($"Total: {totalQuantity:n2} produits"); + col.Item().AlignRight().Text($"Total HT: {total:n2} €"); + col.Item().AlignRight().Text("Taxe : 20 %"); + col.Item().AlignRight().Text($"Total TTC: {(total * 1.2):n2} €"); + }); + + // Signature en bas à droite + page.Footer().AlignRight().Column(col => + { + col.Item().AlignRight().Height(100).Image(signaturePath, ImageScaling.FitArea); + }); + }); + }); + + return document.GeneratePdf(); + } +} diff --git a/PyroFetes/Services/Pdf/PurchaseOrderPdfService.cs b/PyroFetes/Services/Pdf/PurchaseOrderPdfService.cs new file mode 100644 index 0000000..f5cfd90 --- /dev/null +++ b/PyroFetes/Services/Pdf/PurchaseOrderPdfService.cs @@ -0,0 +1,146 @@ +using PyroFetes.Models; +using QuestPDF.Fluent; +using QuestPDF.Helpers; +using QuestPDF.Infrastructure; + +namespace PyroFetes.Services.Pdf; + +public interface IPurchaseOrderPdfService +{ + byte[] Generate(PurchaseOrder purchaseOrder, List lignes); +} + +public class PurchaseOrderPdfService : IPurchaseOrderPdfService +{ + public byte[] Generate(PurchaseOrder purchaseOrder, List lignes) + { + 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; + var document = Document.Create(container => + { + container.Page(page => + { + page.Size(PageSizes.A4); + page.Margin(30); + page.DefaultTextStyle(x => x.FontSize(11)); + + page.Header().Row(row => + { + // Client à gauche + row.RelativeItem().Column(col => + { + col.Item().Text(""); + col.Item().Text(""); + col.Item().Text(""); + col.Item().Text(""); + col.Item().Text("Fournisseur").SemiBold().FontSize(12); + col.Item().Text("Mettre fournisseur ici"); + }); + + // Logo + société à droite + row.ConstantItem(200).Column(col => + { + col.Item().AlignRight().Height(70).Image(logoPath, ImageScaling.FitArea); + col.Item().Height(20); + col.Item().AlignRight().Text("Pyro-Fêtes").SemiBold(); + col.Item().Height(5); + col.Item().AlignRight().Text("24, rue La Fosse Mardeau\n41700 Le Controis-en-Sologne"); + col.Item().Height(5); + col.Item().AlignRight().Text("Téléphone: 02 54 78 77 66"); + col.Item().Height(5); + col.Item().AlignRight().Text("SIRET: 82031463100012"); + col.Item().Height(40); + }); + }); + + page.Content().Column(col => + { + // Titre + date + col.Item().Row(row => + { + row.RelativeItem().Text($"Bon de commande n° {purchaseOrder.Id}") + .FontSize(16).SemiBold(); + + row.ConstantItem(200).AlignRight().Text( + $"Le {DateTime.Now:dd/MM/yyyy}"); + }); + col.Item().Height(20); + + col.Item().LineHorizontal(1); + + // Tableau des lignes + col.Item().Table(table => + { + table.ColumnsDefinition(columns => + { + columns.RelativeColumn(4); // Produit + columns.RelativeColumn(1); // Qté + columns.RelativeColumn(2); // PU + columns.RelativeColumn(2); // Total + }); + + // En-têtes + table.Header(header => + { + header.Cell().Element(CellHeader).Text("Produit"); + header.Cell().Element(CellHeader).AlignRight().Text("Qté"); + header.Cell().Element(CellHeader).AlignRight().Text("PU"); + header.Cell().Element(CellHeader).AlignRight().Text("Total"); + }); + + foreach (var l in lignes) + { + 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} €"); + + totalQuantity += l.Quantity; + total += l.Quantity * l.Quantity; + } + + IContainer CellHeader(IContainer c) => + c.BorderBottom(1).PaddingVertical(5).DefaultTextStyle(x => x.SemiBold()); + + IContainer CellBody(IContainer c) => + c.PaddingVertical(2); + }); + + col.Item().LineHorizontal(1); + col.Item().Height(30); + + col.Item().Row(row => + { + // Colonne gauche : conditions de vente + row.RelativeItem().Column(left => + { + left.Item().Text("Conditions de vente") + .SemiBold().FontSize(12); + left.Item().Text(purchaseOrder.PurchaseConditions) + .FontSize(9); + }); + + // Colonne droite : totaux + row.ConstantItem(180).Column(right => + { + 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} €"); + }); + }); + }); + + // Signature en bas à droite + page.Footer().AlignRight().Column(col => + { + col.Item().AlignRight().Height(100).Image(signaturePath, ImageScaling.FitArea); + }); + }); + }); + + return document.GeneratePdf(); + } +} diff --git a/PyroFetes/Specifications/DeliveryNotes/GetDeliveryNoteByIdWithProductsSpec.cs b/PyroFetes/Specifications/DeliveryNotes/GetDeliveryNoteByIdWithProductsSpec.cs new file mode 100644 index 0000000..5849019 --- /dev/null +++ b/PyroFetes/Specifications/DeliveryNotes/GetDeliveryNoteByIdWithProductsSpec.cs @@ -0,0 +1,15 @@ +using Ardalis.Specification; +using PyroFetes.Models; + +namespace PyroFetes.Specifications.DeliveryNotes; + +public class GetDeliveryNoteByIdWithProductsSpec : Specification +{ + public GetDeliveryNoteByIdWithProductsSpec(int deliveryNoteId) + { + Query + .Where(d => d.Id == deliveryNoteId) + .Include(d => d.ProductDeliveries!) + .ThenInclude(dp => dp.Product); + } +} \ No newline at end of file diff --git a/PyroFetes/Specifications/PurchaseOrders/GetPurchaseOrderByIdWithProductsSpec.cs b/PyroFetes/Specifications/PurchaseOrders/GetPurchaseOrderByIdWithProductsSpec.cs new file mode 100644 index 0000000..734738e --- /dev/null +++ b/PyroFetes/Specifications/PurchaseOrders/GetPurchaseOrderByIdWithProductsSpec.cs @@ -0,0 +1,15 @@ +using Ardalis.Specification; +using PyroFetes.Models; + +namespace PyroFetes.Specifications.PurchaseOrders; + +public class GetPurchaseOrderByIdWithProductsSpec : Specification +{ + public GetPurchaseOrderByIdWithProductsSpec(int purchaseOrderId) + { + Query + .Where(p => p.Id == purchaseOrderId) + .Include(p => p.PurchaseProducts!) + .ThenInclude(pp => pp.Product); + } +} \ No newline at end of file From 6a20676b323e98f12107184e62ce5ce094d3f5ae Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Thu, 4 Dec 2025 15:06:36 +0100 Subject: [PATCH 11/51] added showcompagnon --- PyroFetes/Program.cs | 1 + PyroFetes/Services/Pdf/QuotationPdfService.cs | 12 ++++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/PyroFetes/Program.cs b/PyroFetes/Program.cs index e7c8595..c57c5b1 100644 --- a/PyroFetes/Program.cs +++ b/PyroFetes/Program.cs @@ -51,6 +51,7 @@ builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); +// Ajout des services builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); diff --git a/PyroFetes/Services/Pdf/QuotationPdfService.cs b/PyroFetes/Services/Pdf/QuotationPdfService.cs index 4e3591d..7adcac2 100644 --- a/PyroFetes/Services/Pdf/QuotationPdfService.cs +++ b/PyroFetes/Services/Pdf/QuotationPdfService.cs @@ -1,4 +1,5 @@ using PyroFetes.Models; +using QuestPDF.Companion; using QuestPDF.Fluent; using QuestPDF.Helpers; using QuestPDF.Infrastructure; @@ -74,10 +75,10 @@ public class QuotationPdfService : IQuotationPdfService { table.ColumnsDefinition(columns => { - columns.RelativeColumn(4); // Produit - columns.RelativeColumn(1); // Qté - columns.RelativeColumn(2); // PU - columns.RelativeColumn(2); // Total + columns.RelativeColumn(10); // Produit + columns.RelativeColumn(2); // Qté + columns.RelativeColumn(3); // PU + columns.RelativeColumn(3); // Total }); // En-têtes @@ -137,6 +138,9 @@ public class QuotationPdfService : IQuotationPdfService }); }); }); + + // Pour avoir la vue du PDF en temps réel + document.ShowInCompanion(); return document.GeneratePdf(); } From 17978e7c19393c5ad44b865c57964a5d0d4542b7 Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Thu, 4 Dec 2025 16:38:27 +0100 Subject: [PATCH 12/51] change response in endpoint to generate pdf --- .../Endpoints/DeliveryNotes/GetDeliveryNotePdfEndpoint.cs | 6 ++++-- .../Endpoints/PurchaseOrders/GetPurchaseOrderPdfEndpoint.cs | 6 ++++-- PyroFetes/Endpoints/Quotations/GetQuotationPdfEndpoint.cs | 6 ++++-- PyroFetes/Program.cs | 4 +++- 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/PyroFetes/Endpoints/DeliveryNotes/GetDeliveryNotePdfEndpoint.cs b/PyroFetes/Endpoints/DeliveryNotes/GetDeliveryNotePdfEndpoint.cs index e9dd25a..76bbbab 100644 --- a/PyroFetes/Endpoints/DeliveryNotes/GetDeliveryNotePdfEndpoint.cs +++ b/PyroFetes/Endpoints/DeliveryNotes/GetDeliveryNotePdfEndpoint.cs @@ -1,4 +1,5 @@ -using FastEndpoints; +using System.Net.Mime; +using FastEndpoints; using PyroFetes.DTO.DeliveryNote.Request; using PyroFetes.Models; using PyroFetes.Repositories; @@ -11,12 +12,13 @@ namespace PyroFetes.Endpoints.DeliveryNotes; public class GetDeliveryNotePdfEndpoint( DeliveryNotesRepository deliveryNotesRepository, IDeliveryNotePdfService deliveryNotePdfService) - : Endpoint + : Endpoint { public override void Configure() { Get("/deliveryNotes/{@Id}/pdf", x => new {x.Id}); AllowAnonymous(); + Description(b => b.Produces(200, MediaTypeNames.Application.Pdf)); } public override async Task HandleAsync(GetDeliveryNotePdfDto req, CancellationToken ct) diff --git a/PyroFetes/Endpoints/PurchaseOrders/GetPurchaseOrderPdfEndpoint.cs b/PyroFetes/Endpoints/PurchaseOrders/GetPurchaseOrderPdfEndpoint.cs index a0f48df..a044b50 100644 --- a/PyroFetes/Endpoints/PurchaseOrders/GetPurchaseOrderPdfEndpoint.cs +++ b/PyroFetes/Endpoints/PurchaseOrders/GetPurchaseOrderPdfEndpoint.cs @@ -1,4 +1,5 @@ -using FastEndpoints; +using System.Net.Mime; +using FastEndpoints; using PyroFetes.DTO.PurchaseOrder.Request; using PyroFetes.Models; using PyroFetes.Repositories; @@ -9,12 +10,13 @@ namespace PyroFetes.Endpoints.PurchaseOrders; public class GetPurchaseOrderPdfEndpoint( PurchaseOrdersRepository purchaseOrdersRepository, IPurchaseOrderPdfService purchaseOrderPdfService) - : Endpoint + : Endpoint { public override void Configure() { Get("/purchaseOrders/{@Id}/pdf", x => new {x.Id}); AllowAnonymous(); + Description(b => b.Produces(200, MediaTypeNames.Application.Pdf)); } public override async Task HandleAsync(GetPurchaseOrderPdfDto req, CancellationToken ct) diff --git a/PyroFetes/Endpoints/Quotations/GetQuotationPdfEndpoint.cs b/PyroFetes/Endpoints/Quotations/GetQuotationPdfEndpoint.cs index 1b425f9..2920172 100644 --- a/PyroFetes/Endpoints/Quotations/GetQuotationPdfEndpoint.cs +++ b/PyroFetes/Endpoints/Quotations/GetQuotationPdfEndpoint.cs @@ -1,4 +1,5 @@ -using FastEndpoints; +using System.Net.Mime; +using FastEndpoints; using PyroFetes.DTO.Quotation.Request; using PyroFetes.Models; using PyroFetes.Repositories; @@ -10,12 +11,13 @@ namespace PyroFetes.Endpoints.Quotations; public class GetQuotationPdfEndpoint( QuotationsRepository quotationRepository, IQuotationPdfService quotationPdfService) - : Endpoint + : Endpoint { public override void Configure() { Get("/quotations/{@Id}/pdf", x => new {x.Id}); AllowAnonymous(); + Description(b => b.Produces(200, MediaTypeNames.Application.Pdf)); } public override async Task HandleAsync(GetQuotationPdfDto req, CancellationToken ct) diff --git a/PyroFetes/Program.cs b/PyroFetes/Program.cs index c57c5b1..83ef61b 100644 --- a/PyroFetes/Program.cs +++ b/PyroFetes/Program.cs @@ -4,6 +4,7 @@ using PyroFetes; using FastEndpoints; using FastEndpoints.Swagger; using FastEndpoints.Security; +using Microsoft.Net.Http.Headers; using PyroFetes.MappingProfiles; using PyroFetes.Repositories; using PyroFetes.Services.Pdf; @@ -30,7 +31,8 @@ builder.Services policyBuilder .WithOrigins("http://localhost:4200") .WithMethods("GET", "POST", "PUT", "DELETE", "PATCH") - .AllowAnyHeader(); + .AllowAnyHeader() + .WithExposedHeaders(HeaderNames.ContentDisposition); }); }); From e21e2afea46cb5a707f41dbbb52c72e6f602c5fb Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Thu, 4 Dec 2025 17:11:34 +0100 Subject: [PATCH 13/51] fix error --- PyroFetes/Services/Pdf/QuotationPdfService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PyroFetes/Services/Pdf/QuotationPdfService.cs b/PyroFetes/Services/Pdf/QuotationPdfService.cs index 7adcac2..c5709e1 100644 --- a/PyroFetes/Services/Pdf/QuotationPdfService.cs +++ b/PyroFetes/Services/Pdf/QuotationPdfService.cs @@ -140,7 +140,7 @@ public class QuotationPdfService : IQuotationPdfService }); // Pour avoir la vue du PDF en temps réel - document.ShowInCompanion(); + // document.ShowInCompanion(); return document.GeneratePdf(); } From 65cff130e4150c1572093c2a84ffb3b99961d59f Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Thu, 11 Dec 2025 17:46:23 +0100 Subject: [PATCH 14/51] update deliverynote endpoint --- .../UpdateDeliveryNoteEndpoint.cs | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 PyroFetes/Endpoints/DeliveryNotes/UpdateDeliveryNoteEndpoint.cs diff --git a/PyroFetes/Endpoints/DeliveryNotes/UpdateDeliveryNoteEndpoint.cs b/PyroFetes/Endpoints/DeliveryNotes/UpdateDeliveryNoteEndpoint.cs new file mode 100644 index 0000000..5d347cb --- /dev/null +++ b/PyroFetes/Endpoints/DeliveryNotes/UpdateDeliveryNoteEndpoint.cs @@ -0,0 +1,40 @@ +using FastEndpoints; +using PyroFetes.DTO.DeliveryNote.Request; +using PyroFetes.DTO.DeliveryNote.Response; +using PyroFetes.Models; +using PyroFetes.Repositories; +using PyroFetes.Specifications.DeliveryNotes; + +namespace PyroFetes.Endpoints.DeliveryNotes; + +public class UpdateDeliveryNoteEndpoint( + DeliveryNotesRepository deliveryNotesRepository, + AutoMapper.IMapper mapper) : Endpoint +{ + public override void Configure() + { + Put("/deliveryNotes/{@Id}", x => new {x.Id}); + AllowAnonymous(); + } + + public override async Task HandleAsync(UpdateDeliveryNoteDto req, CancellationToken ct) + { + DeliveryNote? deliveryNote = await deliveryNotesRepository.FirstOrDefaultAsync(new GetDeliveryNoteByIdSpec(req.Id), ct); + + if (deliveryNote == null) + { + await Send.NotFoundAsync(ct); + return; + } + + deliveryNote.TrackingNumber = req.TrackingNumber; + deliveryNote.EstimateDeliveryDate = req.EstimateDeliveryDate; + deliveryNote.ExpeditionDate = req.ExpeditionDate; + deliveryNote.RealDeliveryDate = req.RealDeliveryDate; + deliveryNote.DelivererId = req.DelivererId; + + await deliveryNotesRepository.UpdateAsync(deliveryNote, ct); + + await Send.OkAsync(mapper.Map(deliveryNote), ct); + } +} \ No newline at end of file From 2fa74ccba8bbedc88cd76dee43779b08d27dd727 Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Fri, 12 Dec 2025 21:18:13 +0100 Subject: [PATCH 15/51] added UpdateQuotationDto.cs --- .../Quotation/Request/UpdateQuotationDto.cs | 8 +++++ .../PatchQuotationConditionsSaleEndpoint.cs | 2 -- .../Quotations/UpdateQuotationEndpoint.cs | 36 +++++++++++++++++++ 3 files changed, 44 insertions(+), 2 deletions(-) create mode 100644 PyroFetes/DTO/Quotation/Request/UpdateQuotationDto.cs create mode 100644 PyroFetes/Endpoints/Quotations/UpdateQuotationEndpoint.cs diff --git a/PyroFetes/DTO/Quotation/Request/UpdateQuotationDto.cs b/PyroFetes/DTO/Quotation/Request/UpdateQuotationDto.cs new file mode 100644 index 0000000..dbc0898 --- /dev/null +++ b/PyroFetes/DTO/Quotation/Request/UpdateQuotationDto.cs @@ -0,0 +1,8 @@ +namespace PyroFetes.DTO.Quotation.Request; + +public class UpdateQuotationDto +{ + public int Id { get; set; } + public string? Message { get; set; } + public string? ConditionsSale { get; set; } +} \ No newline at end of file diff --git a/PyroFetes/Endpoints/Quotations/PatchQuotationConditionsSaleEndpoint.cs b/PyroFetes/Endpoints/Quotations/PatchQuotationConditionsSaleEndpoint.cs index a21f60d..e8287f1 100644 --- a/PyroFetes/Endpoints/Quotations/PatchQuotationConditionsSaleEndpoint.cs +++ b/PyroFetes/Endpoints/Quotations/PatchQuotationConditionsSaleEndpoint.cs @@ -1,8 +1,6 @@ using FastEndpoints; -using Microsoft.EntityFrameworkCore; using PyroFetes.DTO.Quotation.Request; using PyroFetes.DTO.Quotation.Response; -using PyroFetes.DTO.QuotationProduct.Response; using PyroFetes.Models; using PyroFetes.Repositories; using PyroFetes.Specifications.Quotations; diff --git a/PyroFetes/Endpoints/Quotations/UpdateQuotationEndpoint.cs b/PyroFetes/Endpoints/Quotations/UpdateQuotationEndpoint.cs new file mode 100644 index 0000000..d59df4d --- /dev/null +++ b/PyroFetes/Endpoints/Quotations/UpdateQuotationEndpoint.cs @@ -0,0 +1,36 @@ +using FastEndpoints; +using PyroFetes.DTO.Quotation.Request; +using PyroFetes.DTO.Quotation.Response; +using PyroFetes.Models; +using PyroFetes.Repositories; +using PyroFetes.Specifications.Quotations; + +namespace PyroFetes.Endpoints.Quotations; + +public class UpdateQuotationEndpoint( + QuotationsRepository quotationsRepository, + AutoMapper.IMapper mapper) : Endpoint +{ + public override void Configure() + { + Put("/quotations/{@Id}", x => new { x.Id }); + AllowAnonymous(); + } + + public override async Task HandleAsync(UpdateQuotationDto req, CancellationToken ct) + { + Quotation? quotation = await quotationsRepository.FirstOrDefaultAsync(new GetQuotationByIdSpec(req.Id), ct); + + if (quotation == null) + { + await Send.NotFoundAsync(ct); + return; + } + + quotation.ConditionsSale = req.ConditionsSale; + quotation.Message = req.Message; + await quotationsRepository.UpdateAsync(quotation, ct); + + await Send.OkAsync(mapper.Map(quotation), ct); + } +} \ No newline at end of file From 2a42e1010fc3138a4e6e5df60450a2b577620fa5 Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Fri, 12 Dec 2025 21:57:58 +0100 Subject: [PATCH 16/51] fix error --- PyroFetes/Endpoints/Quotations/UpdateQuotationEndpoint.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PyroFetes/Endpoints/Quotations/UpdateQuotationEndpoint.cs b/PyroFetes/Endpoints/Quotations/UpdateQuotationEndpoint.cs index d59df4d..3b1f47b 100644 --- a/PyroFetes/Endpoints/Quotations/UpdateQuotationEndpoint.cs +++ b/PyroFetes/Endpoints/Quotations/UpdateQuotationEndpoint.cs @@ -28,7 +28,7 @@ public class UpdateQuotationEndpoint( } quotation.ConditionsSale = req.ConditionsSale; - quotation.Message = req.Message; + quotation.Message = req.Message; await quotationsRepository.UpdateAsync(quotation, ct); await Send.OkAsync(mapper.Map(quotation), ct); From 35d3e58d86f3355866003907c5f4c04af8037e1d Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Sat, 13 Dec 2025 11:24:01 +0100 Subject: [PATCH 17/51] fix error and add CreatePurchaseOrder.cs --- .../Request/CreatePurchaseOrderDto.cs | 9 ++++ .../Response/GetPurchaseOrderDto.cs | 2 +- .../Request/CreatePurchaseOrderProductDto.cs | 8 +++ .../Request/UpdatePurchaseProductDto.cs | 6 +-- .../Response/GetPurchaseProductDto.cs | 4 +- .../PurchaseOrders/CreatePurchaseOrder.cs | 52 +++++++++++++++++++ .../MappingProfiles/DtoToEntityMappings.cs | 1 + .../MappingProfiles/EntityToDtoMappings.cs | 14 ++++- 8 files changed, 88 insertions(+), 8 deletions(-) create mode 100644 PyroFetes/DTO/PurchaseOrder/Request/CreatePurchaseOrderDto.cs create mode 100644 PyroFetes/DTO/PurchaseProduct/Request/CreatePurchaseOrderProductDto.cs create mode 100644 PyroFetes/Endpoints/PurchaseOrders/CreatePurchaseOrder.cs diff --git a/PyroFetes/DTO/PurchaseOrder/Request/CreatePurchaseOrderDto.cs b/PyroFetes/DTO/PurchaseOrder/Request/CreatePurchaseOrderDto.cs new file mode 100644 index 0000000..e7da0dc --- /dev/null +++ b/PyroFetes/DTO/PurchaseOrder/Request/CreatePurchaseOrderDto.cs @@ -0,0 +1,9 @@ +using PyroFetes.DTO.PurchaseProduct.Request; + +namespace PyroFetes.DTO.PurchaseOrder.Request; + +public class CreatePurchaseOrderDto +{ + public string? PurchaseConditions { get; set; } + public List? Products { get; set; } +} diff --git a/PyroFetes/DTO/PurchaseOrder/Response/GetPurchaseOrderDto.cs b/PyroFetes/DTO/PurchaseOrder/Response/GetPurchaseOrderDto.cs index 9854d8b..20dbe4e 100644 --- a/PyroFetes/DTO/PurchaseOrder/Response/GetPurchaseOrderDto.cs +++ b/PyroFetes/DTO/PurchaseOrder/Response/GetPurchaseOrderDto.cs @@ -6,5 +6,5 @@ public class GetPurchaseOrderDto { public int Id { get; set; } public string? PurchaseConditions { get; set; } - public List? GetPurchaseProductDto { get; set; } + public List? Products { get; set; } } \ No newline at end of file diff --git a/PyroFetes/DTO/PurchaseProduct/Request/CreatePurchaseOrderProductDto.cs b/PyroFetes/DTO/PurchaseProduct/Request/CreatePurchaseOrderProductDto.cs new file mode 100644 index 0000000..60c2f07 --- /dev/null +++ b/PyroFetes/DTO/PurchaseProduct/Request/CreatePurchaseOrderProductDto.cs @@ -0,0 +1,8 @@ +namespace PyroFetes.DTO.PurchaseProduct.Request; + +// Pour ajouter les produits lors de la création +public class CreatePurchaseOrderProductDto +{ + public int ProductId { get; set; } + public int Quantity { get; set; } +} \ No newline at end of file diff --git a/PyroFetes/DTO/PurchaseProduct/Request/UpdatePurchaseProductDto.cs b/PyroFetes/DTO/PurchaseProduct/Request/UpdatePurchaseProductDto.cs index ea6b7ae..8a718cb 100644 --- a/PyroFetes/DTO/PurchaseProduct/Request/UpdatePurchaseProductDto.cs +++ b/PyroFetes/DTO/PurchaseProduct/Request/UpdatePurchaseProductDto.cs @@ -7,11 +7,11 @@ public class UpdatePurchaseProductDto public int Quantity { get; set; } - public int ProductReferences { get; set; } + public string? ProductReferences { get; set; } public string? ProductName { get; set; } public decimal ProductDuration {get; set;} - public decimal ProductCaliber { get; set; } - public int ProductApprovalNumber { get; set; } + public int ProductCaliber { get; set; } + public string? ProductApprovalNumber { get; set; } public decimal ProductWeight { get; set; } public decimal ProductNec { get; set; } public string? ProductImage { get; set; } diff --git a/PyroFetes/DTO/PurchaseProduct/Response/GetPurchaseProductDto.cs b/PyroFetes/DTO/PurchaseProduct/Response/GetPurchaseProductDto.cs index d086ed3..b781bd4 100644 --- a/PyroFetes/DTO/PurchaseProduct/Response/GetPurchaseProductDto.cs +++ b/PyroFetes/DTO/PurchaseProduct/Response/GetPurchaseProductDto.cs @@ -6,8 +6,8 @@ public class GetPurchaseProductDto public string? ProductReferences { get; set; } public string? ProductName { get; set; } public decimal ProductDuration {get; set;} - public decimal ProductCaliber { get; set; } - public int ProductApprovalNumber { get; set; } + public int ProductCaliber { get; set; } + public string? ProductApprovalNumber { get; set; } public decimal ProductWeight { get; set; } public decimal ProductNec { get; set; } public string? ProductImage { get; set; } diff --git a/PyroFetes/Endpoints/PurchaseOrders/CreatePurchaseOrder.cs b/PyroFetes/Endpoints/PurchaseOrders/CreatePurchaseOrder.cs new file mode 100644 index 0000000..0fc433a --- /dev/null +++ b/PyroFetes/Endpoints/PurchaseOrders/CreatePurchaseOrder.cs @@ -0,0 +1,52 @@ +using FastEndpoints; +using PyroFetes.DTO.PurchaseOrder.Request; +using PyroFetes.DTO.PurchaseOrder.Response; +using PyroFetes.DTO.PurchaseProduct.Request; +using PyroFetes.DTO.PurchaseProduct.Response; +using PyroFetes.Models; +using PyroFetes.Repositories; +using PyroFetes.Specifications.Products; +using PyroFetes.Specifications.PurchaseOrders; + +namespace PyroFetes.Endpoints.PurchaseOrders; + +public class CreatePurchaseOrder( + PurchaseOrdersRepository purchaseOrdersRepository, + ProductsRepository productsRepository, + AutoMapper.IMapper mapper) : Endpoint +{ + public override void Configure() + { + Post("/purchaseOrders"); + AllowAnonymous(); + } + + public override async Task HandleAsync(CreatePurchaseOrderDto req, CancellationToken ct) + { + var purchaseOrder = new PurchaseOrder + { + PurchaseConditions = req.PurchaseConditions ?? "Conditions non précisées", + PurchaseProducts = new List() + }; + + foreach (var line in req.Products) + { + var product = await productsRepository.GetByIdAsync(line.ProductId, ct); + if (product == null) + { + await Send.NotFoundAsync(ct); + return; + } + + purchaseOrder.PurchaseProducts.Add(new PurchaseProduct + { + ProductId = product.Id, + Quantity = line.Quantity, + }); + } + + await purchaseOrdersRepository.AddAsync(purchaseOrder, ct); + + await Send.OkAsync(mapper.Map(purchaseOrder), ct); + } +} \ No newline at end of file diff --git a/PyroFetes/MappingProfiles/DtoToEntityMappings.cs b/PyroFetes/MappingProfiles/DtoToEntityMappings.cs index d1a1db8..ed46819 100644 --- a/PyroFetes/MappingProfiles/DtoToEntityMappings.cs +++ b/PyroFetes/MappingProfiles/DtoToEntityMappings.cs @@ -38,6 +38,7 @@ public class DtoToEntityMappings : Profile CreateMap(); CreateMap(); + CreateMap(); CreateMap(); CreateMap(); diff --git a/PyroFetes/MappingProfiles/EntityToDtoMappings.cs b/PyroFetes/MappingProfiles/EntityToDtoMappings.cs index aebafa9..b1c6433 100644 --- a/PyroFetes/MappingProfiles/EntityToDtoMappings.cs +++ b/PyroFetes/MappingProfiles/EntityToDtoMappings.cs @@ -32,9 +32,19 @@ public class EntityToDtoMappings : Profile CreateMap(); - CreateMap(); + // CreateMap(); + // + // CreateMap(); - CreateMap(); + CreateMap() + .ForMember(dest => dest.Products, + opt => opt.MapFrom(src => src.PurchaseProducts)); + + CreateMap() + .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)); CreateMap(); From 0802ec9e33562986c1c9b52b78fc0f9150012ec4 Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Sat, 13 Dec 2025 11:39:56 +0100 Subject: [PATCH 18/51] new migration --- ...20251213103736_FixProductTypes.Designer.cs | 1967 +++++++++++++++++ .../20251213103736_FixProductTypes.cs | 22 + 2 files changed, 1989 insertions(+) create mode 100644 PyroFetes/Migrations/20251213103736_FixProductTypes.Designer.cs create mode 100644 PyroFetes/Migrations/20251213103736_FixProductTypes.cs diff --git a/PyroFetes/Migrations/20251213103736_FixProductTypes.Designer.cs b/PyroFetes/Migrations/20251213103736_FixProductTypes.Designer.cs new file mode 100644 index 0000000..f2cfbf3 --- /dev/null +++ b/PyroFetes/Migrations/20251213103736_FixProductTypes.Designer.cs @@ -0,0 +1,1967 @@ +// +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("20251213103736_FixProductTypes")] + partial class FixProductTypes + { + /// + 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/20251213103736_FixProductTypes.cs b/PyroFetes/Migrations/20251213103736_FixProductTypes.cs new file mode 100644 index 0000000..9100f2a --- /dev/null +++ b/PyroFetes/Migrations/20251213103736_FixProductTypes.cs @@ -0,0 +1,22 @@ +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) + { + + } + } +} From be7a3193ab19082927d2a46a71d4d2eee644a629 Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Sat, 13 Dec 2025 15:08:18 +0100 Subject: [PATCH 19/51] added CreateQuotationEndpoint.cs --- .../Quotation/Request/CreateQuotationDto.cs | 10 ++++ .../DTO/Quotation/Response/GetQuotationDto.cs | 2 +- .../Request/CreateProductQuotationDto.cs | 8 +++ .../PurchaseOrders/CreatePurchaseOrder.cs | 2 +- .../Quotations/CreateQuotationEndpoint.cs | 50 +++++++++++++++++++ .../MappingProfiles/DtoToEntityMappings.cs | 1 + .../MappingProfiles/EntityToDtoMappings.cs | 14 +++++- 7 files changed, 83 insertions(+), 4 deletions(-) create mode 100644 PyroFetes/DTO/Quotation/Request/CreateQuotationDto.cs create mode 100644 PyroFetes/DTO/QuotationProduct/Request/CreateProductQuotationDto.cs create mode 100644 PyroFetes/Endpoints/Quotations/CreateQuotationEndpoint.cs diff --git a/PyroFetes/DTO/Quotation/Request/CreateQuotationDto.cs b/PyroFetes/DTO/Quotation/Request/CreateQuotationDto.cs new file mode 100644 index 0000000..e775c9f --- /dev/null +++ b/PyroFetes/DTO/Quotation/Request/CreateQuotationDto.cs @@ -0,0 +1,10 @@ +using PyroFetes.DTO.QuotationProduct.Request; + +namespace PyroFetes.DTO.Quotation.Request; + +public class CreateQuotationDto +{ + public string? Message { get; set; } + public string? ConditionsSale { get; set; } + public List? Products { get; set; } +} \ No newline at end of file diff --git a/PyroFetes/DTO/Quotation/Response/GetQuotationDto.cs b/PyroFetes/DTO/Quotation/Response/GetQuotationDto.cs index 589197c..f77195f 100644 --- a/PyroFetes/DTO/Quotation/Response/GetQuotationDto.cs +++ b/PyroFetes/DTO/Quotation/Response/GetQuotationDto.cs @@ -7,5 +7,5 @@ public class GetQuotationDto public int Id { get; set; } public string? Message { get; set; } public string? ConditionsSale { get; set; } - public List? GetQuotationProductDto { get; set; } + public List? Products { get; set; } } \ No newline at end of file diff --git a/PyroFetes/DTO/QuotationProduct/Request/CreateProductQuotationDto.cs b/PyroFetes/DTO/QuotationProduct/Request/CreateProductQuotationDto.cs new file mode 100644 index 0000000..51b0771 --- /dev/null +++ b/PyroFetes/DTO/QuotationProduct/Request/CreateProductQuotationDto.cs @@ -0,0 +1,8 @@ +namespace PyroFetes.DTO.QuotationProduct.Request; + +// Pour création global +public class CreateProductQuotationDto +{ + public int ProductId { get; set; } + public int Quantity { get; set; } +} \ No newline at end of file diff --git a/PyroFetes/Endpoints/PurchaseOrders/CreatePurchaseOrder.cs b/PyroFetes/Endpoints/PurchaseOrders/CreatePurchaseOrder.cs index 0fc433a..b3ca875 100644 --- a/PyroFetes/Endpoints/PurchaseOrders/CreatePurchaseOrder.cs +++ b/PyroFetes/Endpoints/PurchaseOrders/CreatePurchaseOrder.cs @@ -23,7 +23,7 @@ public class CreatePurchaseOrder( public override async Task HandleAsync(CreatePurchaseOrderDto req, CancellationToken ct) { - var purchaseOrder = new PurchaseOrder + PurchaseOrder purchaseOrder = new PurchaseOrder { PurchaseConditions = req.PurchaseConditions ?? "Conditions non précisées", PurchaseProducts = new List() diff --git a/PyroFetes/Endpoints/Quotations/CreateQuotationEndpoint.cs b/PyroFetes/Endpoints/Quotations/CreateQuotationEndpoint.cs new file mode 100644 index 0000000..a7003c8 --- /dev/null +++ b/PyroFetes/Endpoints/Quotations/CreateQuotationEndpoint.cs @@ -0,0 +1,50 @@ +using FastEndpoints; +using PyroFetes.DTO.Quotation.Request; +using PyroFetes.DTO.Quotation.Response; +using PyroFetes.Models; +using PyroFetes.Repositories; + +namespace PyroFetes.Endpoints.Quotations; + +public class CreateQuotationEndpoint( + QuotationsRepository quotationsRepository, + ProductsRepository productsRepository, + AutoMapper.IMapper mapper) : Endpoint +{ + public override void Configure() + { + Post("/quotations"); + AllowAnonymous(); + } + + public override async Task HandleAsync(CreateQuotationDto req, CancellationToken ct) + { + Quotation quotation = new Quotation + { + Message = req.Message, + ConditionsSale = req.ConditionsSale ?? "Conditions non précisées", + CustomerId = 1, // A changer + QuotationProducts = new List() + }; + + foreach (var line in req.Products) + { + var product = await productsRepository.GetByIdAsync(line.ProductId, ct); + if (product == null) + { + await Send.NotFoundAsync(ct); + return; + } + + quotation.QuotationProducts.Add(new QuotationProduct + { + ProductId = product.Id, + Quantity = line.Quantity, + }); + } + + await quotationsRepository.AddAsync(quotation, ct); + + await Send.OkAsync(mapper.Map(quotation), ct); + } +} \ No newline at end of file diff --git a/PyroFetes/MappingProfiles/DtoToEntityMappings.cs b/PyroFetes/MappingProfiles/DtoToEntityMappings.cs index ed46819..132c135 100644 --- a/PyroFetes/MappingProfiles/DtoToEntityMappings.cs +++ b/PyroFetes/MappingProfiles/DtoToEntityMappings.cs @@ -47,6 +47,7 @@ public class DtoToEntityMappings : Profile CreateMap(); CreateMap(); + CreateMap(); CreateMap(); CreateMap(); diff --git a/PyroFetes/MappingProfiles/EntityToDtoMappings.cs b/PyroFetes/MappingProfiles/EntityToDtoMappings.cs index b1c6433..617891f 100644 --- a/PyroFetes/MappingProfiles/EntityToDtoMappings.cs +++ b/PyroFetes/MappingProfiles/EntityToDtoMappings.cs @@ -46,9 +46,19 @@ public class EntityToDtoMappings : Profile .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(); - CreateMap(); + CreateMap() + .ForMember(dest => dest.Products, + opt => opt.MapFrom(src => src.QuotationProducts)); + + CreateMap() + .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)); CreateMap(); From 29e2036965515672f51e35268a76a5bec34f584c Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Sat, 13 Dec 2025 15:34:29 +0100 Subject: [PATCH 20/51] fix error --- .../DTO/QuotationProduct/Request/CreateQuotationProductDto.cs | 4 ++-- .../DTO/QuotationProduct/Request/UpdateQuotationProductDto.cs | 4 ++-- .../DTO/QuotationProduct/Response/GetQuotationProductDto.cs | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/PyroFetes/DTO/QuotationProduct/Request/CreateQuotationProductDto.cs b/PyroFetes/DTO/QuotationProduct/Request/CreateQuotationProductDto.cs index 86610d4..a4e1e5a 100644 --- a/PyroFetes/DTO/QuotationProduct/Request/CreateQuotationProductDto.cs +++ b/PyroFetes/DTO/QuotationProduct/Request/CreateQuotationProductDto.cs @@ -12,8 +12,8 @@ public class CreateQuotationProductDto public int ProductReferences { get; set; } public string? ProductName { get; set; } public decimal ProductDuration {get; set;} - public decimal ProductCaliber { get; set; } - public int ProductApprovalNumber { get; set; } + public int ProductCaliber { get; set; } + public string? ProductApprovalNumber { get; set; } public decimal ProductWeight { get; set; } public decimal ProductNec { get; set; } public string? ProductImage { get; set; } diff --git a/PyroFetes/DTO/QuotationProduct/Request/UpdateQuotationProductDto.cs b/PyroFetes/DTO/QuotationProduct/Request/UpdateQuotationProductDto.cs index 0247b6f..a726136 100644 --- a/PyroFetes/DTO/QuotationProduct/Request/UpdateQuotationProductDto.cs +++ b/PyroFetes/DTO/QuotationProduct/Request/UpdateQuotationProductDto.cs @@ -13,8 +13,8 @@ public class UpdateQuotationProductDto public int ProductReferences { get; set; } public string? ProductName { get; set; } public decimal ProductDuration {get; set;} - public decimal ProductCaliber { get; set; } - public int ProductApprovalNumber { get; set; } + public int ProductCaliber { get; set; } + public string? ProductApprovalNumber { get; set; } public decimal ProductWeight { get; set; } public decimal ProductNec { get; set; } public string? ProductImage { get; set; } diff --git a/PyroFetes/DTO/QuotationProduct/Response/GetQuotationProductDto.cs b/PyroFetes/DTO/QuotationProduct/Response/GetQuotationProductDto.cs index 4ef123b..86643f9 100644 --- a/PyroFetes/DTO/QuotationProduct/Response/GetQuotationProductDto.cs +++ b/PyroFetes/DTO/QuotationProduct/Response/GetQuotationProductDto.cs @@ -12,8 +12,8 @@ public class GetQuotationProductDto public string? ProductReferences { get; set; } public string? ProductName { get; set; } public decimal ProductDuration {get; set;} - public decimal ProductCaliber { get; set; } - public int ProductApprovalNumber { get; set; } + public int ProductCaliber { get; set; } + public string? ProductApprovalNumber { get; set; } public decimal ProductWeight { get; set; } public decimal ProductNec { get; set; } public string? ProductImage { get; set; } From 3487baad8725e7d221417844b7b055150d0fbc7c Mon Sep 17 00:00:00 2001 From: Cristiano Date: Thu, 18 Dec 2025 14:41:45 +0100 Subject: [PATCH 21/51] Added endpoint to get products under their limit --- .../GetAllProductsUnderLimitEndpoint.cs | 21 +++++++++++++++++++ .../Products/GetProductsUnderLimitSpec.cs | 14 +++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 PyroFetes/Endpoints/Products/GetAllProductsUnderLimitEndpoint.cs create mode 100644 PyroFetes/Specifications/Products/GetProductsUnderLimitSpec.cs diff --git a/PyroFetes/Endpoints/Products/GetAllProductsUnderLimitEndpoint.cs b/PyroFetes/Endpoints/Products/GetAllProductsUnderLimitEndpoint.cs new file mode 100644 index 0000000..2057c35 --- /dev/null +++ b/PyroFetes/Endpoints/Products/GetAllProductsUnderLimitEndpoint.cs @@ -0,0 +1,21 @@ +using AutoMapper; +using FastEndpoints; +using PyroFetes.DTO.Product.Response; +using PyroFetes.Repositories; +using PyroFetes.Specifications.Products; + +namespace PyroFetes.Endpoints.Products; + +public class GetAllProductsUnderLimitEndpoint(ProductsRepository productsRepository) : EndpointWithoutRequest> +{ + public override void Configure() + { + Get("/products/underLimit"); + AllowAnonymous(); + } + + public override async Task HandleAsync(CancellationToken ct) + { + await Send.OkAsync(await productsRepository.ProjectToListAsync(new GetProductsUnderLimitSpec(), ct), ct); + } +} \ No newline at end of file diff --git a/PyroFetes/Specifications/Products/GetProductsUnderLimitSpec.cs b/PyroFetes/Specifications/Products/GetProductsUnderLimitSpec.cs new file mode 100644 index 0000000..26c8d12 --- /dev/null +++ b/PyroFetes/Specifications/Products/GetProductsUnderLimitSpec.cs @@ -0,0 +1,14 @@ +using Ardalis.Specification; +using PyroFetes.Models; + +namespace PyroFetes.Specifications.Products; + +public sealed class GetProductsUnderLimitSpec : Specification +{ + public GetProductsUnderLimitSpec() + { + Query + .Include(p => p.QuotationProducts) + .Where(p => p.QuotationProducts.Any(q => q.Quantity < p.MinimalQuantity)); + } +} \ No newline at end of file From 418c2b3d16ce6b8b008566d871dd175bb03f056f Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Sat, 20 Dec 2025 15:39:05 +0100 Subject: [PATCH 22/51] fix error --- .../DTO/ProductDelivery/Response/GetProductDeliveryDto.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/PyroFetes/DTO/ProductDelivery/Response/GetProductDeliveryDto.cs b/PyroFetes/DTO/ProductDelivery/Response/GetProductDeliveryDto.cs index ef82503..9fdbe04 100644 --- a/PyroFetes/DTO/ProductDelivery/Response/GetProductDeliveryDto.cs +++ b/PyroFetes/DTO/ProductDelivery/Response/GetProductDeliveryDto.cs @@ -3,11 +3,11 @@ namespace PyroFetes.DTO.ProductDelivery.Response; public class GetProductDeliveryDto { public int ProductId { get; set; } - public int ProductReference { get; set; } + public string? ProductReference { get; set; } public string? ProductName { get; set; } public decimal ProductDuration {get; set;} - public decimal ProductCaliber { get; set; } - public int ProductApprovalNumber { get; set; } + public int ProductCaliber { get; set; } + public string? ProductApprovalNumber { get; set; } public decimal ProductWeight { get; set; } public decimal ProductNec { get; set; } public string? ProductImage { get; set; } From 0312f020288074799e441fb5f31b9a634bf04e72 Mon Sep 17 00:00:00 2001 From: Cristiano Date: Thu, 26 Mar 2026 15:35:11 +0100 Subject: [PATCH 23/51] Some fixes --- PyroFetes/DTO/Price/Response/GetPriceDto.cs | 2 +- .../DTO/PurchaseProduct/Response/GetPurchaseProductDto.cs | 1 + PyroFetes/MappingProfiles/EntityToDtoMappings.cs | 3 ++- PyroFetes/Specifications/Products/GetProductByIdSpec.cs | 3 ++- .../PurchaseOrders/GetPurchaseOrderByIdWithProductsSpec.cs | 5 +++-- PyroFetes/Specifications/Quotations/GetQuotationByIdSpec.cs | 2 +- 6 files changed, 10 insertions(+), 6 deletions(-) diff --git a/PyroFetes/DTO/Price/Response/GetPriceDto.cs b/PyroFetes/DTO/Price/Response/GetPriceDto.cs index fbd38a8..32ae092 100644 --- a/PyroFetes/DTO/Price/Response/GetPriceDto.cs +++ b/PyroFetes/DTO/Price/Response/GetPriceDto.cs @@ -15,7 +15,7 @@ public class GetPriceDto public int SupplierDeliveryDelay { get; set; } public int ProductId { get; set; } - public string? ProductReferences { get; set; } + public string? ProductReference { get; set; } public string? ProductName { get; set; } public decimal ProductDuration {get; set;} public int ProductCaliber { get; set; } diff --git a/PyroFetes/DTO/PurchaseProduct/Response/GetPurchaseProductDto.cs b/PyroFetes/DTO/PurchaseProduct/Response/GetPurchaseProductDto.cs index b781bd4..cdfc15e 100644 --- a/PyroFetes/DTO/PurchaseProduct/Response/GetPurchaseProductDto.cs +++ b/PyroFetes/DTO/PurchaseProduct/Response/GetPurchaseProductDto.cs @@ -13,6 +13,7 @@ public class GetPurchaseProductDto public string? ProductImage { get; set; } public string? ProductLink { get; set; } public int ProductMinimalQuantity { get; set; } + public decimal ProductPrice { get; set; } public int PurchaseOrderId { get; set; } public string? PurchaseOrderPurchaseConditions { get; set; } diff --git a/PyroFetes/MappingProfiles/EntityToDtoMappings.cs b/PyroFetes/MappingProfiles/EntityToDtoMappings.cs index 617891f..b1d0b85 100644 --- a/PyroFetes/MappingProfiles/EntityToDtoMappings.cs +++ b/PyroFetes/MappingProfiles/EntityToDtoMappings.cs @@ -34,7 +34,8 @@ public class EntityToDtoMappings : Profile // CreateMap(); // - // CreateMap(); + CreateMap(); + CreateMap() .ForMember(dest => dest.Products, diff --git a/PyroFetes/Specifications/Products/GetProductByIdSpec.cs b/PyroFetes/Specifications/Products/GetProductByIdSpec.cs index fb7322c..db1421f 100644 --- a/PyroFetes/Specifications/Products/GetProductByIdSpec.cs +++ b/PyroFetes/Specifications/Products/GetProductByIdSpec.cs @@ -8,6 +8,7 @@ public sealed class GetProductByIdSpec : Specification public GetProductByIdSpec(int? productId) { Query - .Where(p => p.Id == productId); + .Where(p => p.Id == productId) + .Include(p => p.Prices); } } \ No newline at end of file diff --git a/PyroFetes/Specifications/PurchaseOrders/GetPurchaseOrderByIdWithProductsSpec.cs b/PyroFetes/Specifications/PurchaseOrders/GetPurchaseOrderByIdWithProductsSpec.cs index 734738e..7bac3f8 100644 --- a/PyroFetes/Specifications/PurchaseOrders/GetPurchaseOrderByIdWithProductsSpec.cs +++ b/PyroFetes/Specifications/PurchaseOrders/GetPurchaseOrderByIdWithProductsSpec.cs @@ -10,6 +10,7 @@ public class GetPurchaseOrderByIdWithProductsSpec : Specification Query .Where(p => p.Id == purchaseOrderId) .Include(p => p.PurchaseProducts!) - .ThenInclude(pp => pp.Product); + .ThenInclude(pp => pp.Product) + .ThenInclude(pp=> pp!.Prices); } -} \ No newline at end of file +} \ No newline at end of file diff --git a/PyroFetes/Specifications/Quotations/GetQuotationByIdSpec.cs b/PyroFetes/Specifications/Quotations/GetQuotationByIdSpec.cs index 37424e9..5f1e183 100644 --- a/PyroFetes/Specifications/Quotations/GetQuotationByIdSpec.cs +++ b/PyroFetes/Specifications/Quotations/GetQuotationByIdSpec.cs @@ -8,7 +8,7 @@ public sealed class GetQuotationByIdSpec : Specification public GetQuotationByIdSpec(int quotationId) { Query - .Include(q => q.QuotationProducts) + .Include(q => q.QuotationProducts) .Where(x => x.Id == quotationId); } } \ No newline at end of file From fe58e5e7e7a35cdcf5db530bfece4a186d66837c Mon Sep 17 00:00:00 2001 From: Cristiano Date: Thu, 26 Mar 2026 17:23:09 +0100 Subject: [PATCH 24/51] 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 From 656100d15e1583800a000732f73e5742361bdf79 Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Sun, 24 May 2026 17:22:03 +0100 Subject: [PATCH 25/51] Refactor all code --- .../Request/CreateDeliveryNoteDto.cs | 6 +- PyroFetes/DTO/Price/Request/CreatePriceDto.cs | 21 +- PyroFetes/DTO/Price/Request/UpdatePriceDto.cs | 28 - PyroFetes/DTO/Price/Response/GetPriceDto.cs | 10 - .../DTO/Product/Request/CreateProductDto.cs | 15 - .../Request/CreateProductDeliveryDto.cs | 8 - .../Request/UpdateProductDeliveryDto.cs | 8 - .../Response/GetProductDeliveryDto.cs | 10 - .../Response/GetPurchaseOrderDto.cs | 1 + .../Request/CreatePurchaseProductDto.cs | 1 - .../Request/UpdatePurchaseProductDto.cs | 22 - .../Response/GetPurchaseProductDto.cs | 5 +- .../Request/CreateProductQuotationDto.cs | 1 - .../Request/CreateQuotationProductDto.cs | 16 +- .../Request/UpdateQuotationProductDto.cs | 23 - .../Response/GetQuotationProductDto.cs | 6 +- .../SettingDTO/Request/CreateSettingDto.cs | 4 +- .../PatchSettingElectronicSignatureDto.cs | 2 +- .../SettingDTO/Request/PatchSettingLogoDto.cs | 2 +- .../DTO/Supplier/Response/GetSupplierDto.cs | 2 - .../Deliverers/CreateDelivererEndpoint.cs | 11 +- .../Deliverers/DeleteDelivererEndpoint.cs | 14 +- .../Deliverers/GetAllDelivererEndpoint.cs | 4 - .../Deliverers/GetDelivererEndpoint.cs | 13 +- .../Deliverers/UpdateDelivererEndpoint.cs | 22 +- .../CreateDeliveryNoteEndpoint.cs | 40 +- .../DeleteDeliveryNoteEndpoint.cs | 11 +- .../GetAllDeliveryNoteEndpoint.cs | 4 +- .../DeliveryNotes/GetDeliveryNoteEndpoint.cs | 9 +- .../GetDeliveryNotePdfEndpoint.cs | 22 +- .../PatchRealDeliveryDateEndpoint.cs | 28 +- .../UpdateDeliveryNoteEndpoint.cs | 28 +- .../Endpoints/Prices/CreatePriceEndpoint.cs | 84 - .../Products/DeleteProductEndpoint.cs | 14 +- .../Products/GetAllProductsEndpoint.cs | 2 - .../GetAllProductsUnderLimitEndpoint.cs | 3 +- .../Endpoints/Products/GetProductEndpoint.cs | 9 +- .../PatchProductMinimalStockEndpoint.cs | 18 +- .../Products/UpdateProductEndpoint.cs | 30 +- .../AddProductFromPurchaseOrderEndpoint.cs | 32 + .../PurchaseOrders/CreatePurchaseOrder.cs | 48 +- ...DeleteProductFromPurchaseOrderEndpoint.cs} | 16 +- .../DeletePurchaseOrderEndpoint.cs | 19 +- .../GetAllPurchaseOrderEndpoint.cs | 2 - .../GetPurchaseOrderEndpoint.cs | 14 +- .../GetPurchaseOrderPdfEndpoint.cs | 21 +- ...PurchaseOrderPurchaseConditionsEndpoint.cs | 19 +- .../PatchPurchaseProductQuantityEndpoint.cs | 35 + .../CreatePurchaseProductEndpoint.cs | 56 - .../PatchPurchaseProductQuantityEndpoint.cs | 38 - .../CreateQuotationProductEndpoint.cs | 58 - .../AddProductoToQuotationEndpoint.cs | 35 + .../Quotations/CreateQuotationEndpoint.cs | 50 +- .../DeleteProductFromQuotationEndpoint.cs} | 15 +- .../Quotations/DeleteQuotationEndpoint.cs | 19 +- .../Quotations/GetAllQuotationEndpoint.cs | 3 - .../Quotations/GetQuotationEndpoint.cs | 10 +- .../Quotations/GetQuotationPdfEndpoint.cs | 18 +- .../PatchQuotationConditionsSaleEndpoint.cs | 15 +- .../PatchQuotationMessageEndpoint.cs | 35 + .../PatchQuotationProductQuantityEndpoint.cs | 20 +- .../Quotations/UpdateQuotationEndpoint.cs | 17 +- .../Settings/CreateSettingEndpoint.cs | 28 +- .../Settings/DeleteSettingEndpoint.cs | 12 +- .../Endpoints/Settings/GetSettingEndpoint.cs | 9 +- ...PatchSettingElectronicSignatureEndpoint.cs | 29 +- .../Settings/PatchSettingLogoEndpoint.cs | 25 +- .../Suppliers/AddProductToSupplierEndpoint.cs | 43 + .../Suppliers/CreateSupplierEndpoint.cs | 21 +- .../DeleteProductToSupplierEndpoint.cs} | 16 +- .../Suppliers/DeleteSupplierEndpoint.cs | 14 +- .../Suppliers/GetAllSuppliersEndpoint.cs | 1 - .../Suppliers/GetSupplierEndpoint.cs | 13 +- .../PatchPriceEndpoint.cs | 20 +- .../PatchSupplierDeliveryDelayEndpoint.cs | 17 +- .../Suppliers/UpdateSupplierEndpoint.cs | 26 +- .../Endpoints/Users/ConnectUserEndpoint.cs | 25 +- .../Endpoints/Users/CreateUserEndpoint.cs | 23 +- .../Endpoints/Users/DeleteUserEndpoint.cs | 10 +- .../Endpoints/Users/GetAllUsersEndpoint.cs | 1 - PyroFetes/Endpoints/Users/GetUserEndpoint.cs | 13 +- .../Users/PatchUserPasswordEndpoint.cs | 15 +- .../Endpoints/Users/UpdateUserEndpoint.cs | 27 +- .../GetTotalQuantityEndpoint.cs | 15 +- .../PatchWareHouseProductQuantityEndpoint.cs | 26 +- .../MappingProfiles/DtoToEntityMappings.cs | 68 +- .../MappingProfiles/EntityToDtoMappings.cs | 41 +- ...60524095820_ChangeDatabaseName.Designer.cs | 1983 +++++++++++++++++ .../20260524095820_ChangeDatabaseName.cs | 22 + PyroFetes/Program.cs | 2 +- PyroFetes/PyroFetes.csproj | 10 +- PyroFetes/PyroFetesDbContext.cs | 10 +- .../Services/Pdf/DeliveryNotePdfService.cs | 16 +- .../Services/Pdf/PurchaseOrderPdfService.cs | 16 +- PyroFetes/Services/Pdf/QuotationPdfService.cs | 17 +- .../Deliverers/GetDelivererByIdSpec.cs | 2 +- .../DeliveryNotes/GetAllDeliveryNoteSpec.cs | 16 + .../DeliveryNotes/GetDeliveryNoteByIdSpec.cs | 5 +- .../GetDeliveryNoteByIdWithProductsSpec.cs | 8 +- .../GetPriceByProductIdAndSupplierIdSpec.cs | 4 +- .../Products/GetProductByIdSpec.cs | 4 +- .../Products/GetProductsUnderLimitSpec.cs | 2 +- .../GetPurchaseOrderByIdSpec.cs | 7 +- .../GetPurchaseOrderByIdWithProductsSpec.cs | 10 +- ...roductByProductIdAndPurchaseOrderIdSpec.cs | 2 +- ...ionProductByProductIdAndQuotationIdSpec.cs | 2 +- .../Quotations/GetQuotationByIdSpec.cs | 5 +- .../GetQuotationByIdWithProductsSpec.cs | 8 +- .../Settings/GetSettingByIdSpec.cs | 2 +- .../Suppliers/GetSupplierByIdSpec.cs | 4 +- .../Specifications/Users/GetUserByIdSpec.cs | 2 +- .../Specifications/Users/GetUserByNameSpec.cs | 2 +- .../GetWarehouseProductByProductIdSpec.cs | 9 +- PyroFetes/data.sql | 986 ++++---- PyroFetes/docker-compose.yml | 33 - PyroFetes/wwwroot/Images/logo.jpg | Bin 47397 -> 0 bytes PyroFetes/wwwroot/Images/signature.png | Bin 10292 -> 0 bytes 117 files changed, 3317 insertions(+), 1562 deletions(-) delete mode 100644 PyroFetes/DTO/Price/Request/UpdatePriceDto.cs delete mode 100644 PyroFetes/DTO/Product/Request/CreateProductDto.cs delete mode 100644 PyroFetes/DTO/ProductDelivery/Request/CreateProductDeliveryDto.cs delete mode 100644 PyroFetes/DTO/ProductDelivery/Request/UpdateProductDeliveryDto.cs delete mode 100644 PyroFetes/DTO/PurchaseProduct/Request/UpdatePurchaseProductDto.cs delete mode 100644 PyroFetes/DTO/QuotationProduct/Request/UpdateQuotationProductDto.cs delete mode 100644 PyroFetes/Endpoints/Prices/CreatePriceEndpoint.cs create mode 100644 PyroFetes/Endpoints/PurchaseOrders/AddProductFromPurchaseOrderEndpoint.cs rename PyroFetes/Endpoints/{PurchaseProducts/DeletePurchaseProductEndpoint.cs => PurchaseOrders/DeleteProductFromPurchaseOrderEndpoint.cs} (51%) create mode 100644 PyroFetes/Endpoints/PurchaseOrders/PatchPurchaseProductQuantityEndpoint.cs delete mode 100644 PyroFetes/Endpoints/PurchaseProducts/CreatePurchaseProductEndpoint.cs delete mode 100644 PyroFetes/Endpoints/PurchaseProducts/PatchPurchaseProductQuantityEndpoint.cs delete mode 100644 PyroFetes/Endpoints/QuotationProducts/CreateQuotationProductEndpoint.cs create mode 100644 PyroFetes/Endpoints/Quotations/AddProductoToQuotationEndpoint.cs rename PyroFetes/Endpoints/{QuotationProducts/DeleteQuotationProductEndpoint.cs => Quotations/DeleteProductFromQuotationEndpoint.cs} (55%) create mode 100644 PyroFetes/Endpoints/Quotations/PatchQuotationMessageEndpoint.cs rename PyroFetes/Endpoints/{QuotationProducts => Quotations}/PatchQuotationProductQuantityEndpoint.cs (52%) create mode 100644 PyroFetes/Endpoints/Suppliers/AddProductToSupplierEndpoint.cs rename PyroFetes/Endpoints/{Prices/DeletePriceEndpoint.cs => Suppliers/DeleteProductToSupplierEndpoint.cs} (51%) rename PyroFetes/Endpoints/{Prices => Suppliers}/PatchPriceEndpoint.cs (59%) create mode 100644 PyroFetes/Migrations/20260524095820_ChangeDatabaseName.Designer.cs create mode 100644 PyroFetes/Migrations/20260524095820_ChangeDatabaseName.cs create mode 100644 PyroFetes/Specifications/DeliveryNotes/GetAllDeliveryNoteSpec.cs delete mode 100644 PyroFetes/docker-compose.yml delete mode 100644 PyroFetes/wwwroot/Images/logo.jpg delete mode 100644 PyroFetes/wwwroot/Images/signature.png diff --git a/PyroFetes/DTO/DeliveryNote/Request/CreateDeliveryNoteDto.cs b/PyroFetes/DTO/DeliveryNote/Request/CreateDeliveryNoteDto.cs index c2ee0d9..b486e16 100644 --- a/PyroFetes/DTO/DeliveryNote/Request/CreateDeliveryNoteDto.cs +++ b/PyroFetes/DTO/DeliveryNote/Request/CreateDeliveryNoteDto.cs @@ -5,8 +5,8 @@ public class CreateDeliveryNoteDto public string? TrackingNumber { get; set; } public DateOnly EstimateDeliveryDate { get; set; } public DateOnly ExpeditionDate { get; set; } - + public int DelivererId { get; set; } - - public Dictionary? ProductQuantities { get; set; } + + public Dictionary? ProductQuantities { get; set; } } \ No newline at end of file diff --git a/PyroFetes/DTO/Price/Request/CreatePriceDto.cs b/PyroFetes/DTO/Price/Request/CreatePriceDto.cs index 26e52e7..c465649 100644 --- a/PyroFetes/DTO/Price/Request/CreatePriceDto.cs +++ b/PyroFetes/DTO/Price/Request/CreatePriceDto.cs @@ -3,25 +3,6 @@ public class CreatePriceDto { public decimal SellingPrice { get; set; } - public int? SupplierId { get; set; } - public string? SupplierName { get; set; } - public string? SupplierEmail { get; set; } - public string? SupplierPhone { get; set; } - public string? SupplierAddress { get; set; } - public string? SupplierZipCode { get; set; } - public string? SupplierCity { get; set; } - public int SupplierDeliveryDelay { get; set; } - - public int? ProductId { get; set; } - public string? ProductReferences { get; set; } - public string? ProductName { get; set; } - public decimal ProductDuration {get; set;} - public int ProductCaliber { get; set; } - public string? ProductApprovalNumber { get; set; } - public decimal ProductWeight { get; set; } - public decimal ProductNec { get; set; } - public string? ProductImage { get; set; } - public string? ProductLink { get; set; } - public int ProductMinimalQuantity { get; set; } + public int ProductId { get; set; } } \ No newline at end of file diff --git a/PyroFetes/DTO/Price/Request/UpdatePriceDto.cs b/PyroFetes/DTO/Price/Request/UpdatePriceDto.cs deleted file mode 100644 index 1eac827..0000000 --- a/PyroFetes/DTO/Price/Request/UpdatePriceDto.cs +++ /dev/null @@ -1,28 +0,0 @@ -namespace PyroFetes.DTO.Price.Request; - -public class UpdatePriceDto -{ - public int Id { get; set; } - public decimal SellingPrice { get; set; } - - public int SupplierId { get; set; } - public string? SupplierName { get; set; } - public string? SupplierEmail { get; set; } - public string? SupplierPhone { get; set; } - public string? SupplierAddress { get; set; } - public int SupplierZipCode { get; set; } - public string? SupplierCity { get; set; } - public int SupplierDeliveryDelay { get; set; } - - public int ProductId { get; set; } - public string? ProductReferences { get; set; } - public string? ProductName { get; set; } - public decimal ProductDuration {get; set;} - public decimal ProductCaliber { get; set; } - public int ProductApprovalNumber { get; set; } - public decimal ProductWeight { get; set; } - public decimal ProductNec { get; set; } - public string? ProductImage { get; set; } - public string? ProductLink { get; set; } - public int ProductMinimalQuantity { get; set; } -} \ No newline at end of file diff --git a/PyroFetes/DTO/Price/Response/GetPriceDto.cs b/PyroFetes/DTO/Price/Response/GetPriceDto.cs index 32ae092..6657f2f 100644 --- a/PyroFetes/DTO/Price/Response/GetPriceDto.cs +++ b/PyroFetes/DTO/Price/Response/GetPriceDto.cs @@ -2,18 +2,8 @@ public class GetPriceDto { - public int Id { get; set; } public decimal SellingPrice { get; set; } - public int SupplierId { get; set; } - public string? SupplierName { get; set; } - public string? SupplierEmail { get; set; } - public string? SupplierPhone { get; set; } - public string? SupplierAddress { get; set; } - public string? SupplierZipCode { get; set; } - public string? SupplierCity { get; set; } - public int SupplierDeliveryDelay { get; set; } - public int ProductId { get; set; } public string? ProductReference { get; set; } public string? ProductName { get; set; } diff --git a/PyroFetes/DTO/Product/Request/CreateProductDto.cs b/PyroFetes/DTO/Product/Request/CreateProductDto.cs deleted file mode 100644 index ddc689c..0000000 --- a/PyroFetes/DTO/Product/Request/CreateProductDto.cs +++ /dev/null @@ -1,15 +0,0 @@ -namespace PyroFetes.DTO.Product.Request; - -public class CreateProductDto -{ - public string? References { get; set; } - public string? Name { get; set; } - public decimal Duration {get; set;} - public int Caliber { get; set; } - public string? ApprovalNumber { get; set; } - public decimal Weight { get; set; } - public decimal Nec { get; set; } - public string? Image { get; set; } - public string? Link { get; set; } - public int MinimalQuantity { get; set; } -} \ No newline at end of file diff --git a/PyroFetes/DTO/ProductDelivery/Request/CreateProductDeliveryDto.cs b/PyroFetes/DTO/ProductDelivery/Request/CreateProductDeliveryDto.cs deleted file mode 100644 index d993ad3..0000000 --- a/PyroFetes/DTO/ProductDelivery/Request/CreateProductDeliveryDto.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace PyroFetes.DTO.ProductDelivery.Request; - -public class CreateProductDeliveryDto -{ - public int ProductId { get; set; } - public int DeliveryNoteId { get; set; } - public int Quantity { get; set; } -} \ No newline at end of file diff --git a/PyroFetes/DTO/ProductDelivery/Request/UpdateProductDeliveryDto.cs b/PyroFetes/DTO/ProductDelivery/Request/UpdateProductDeliveryDto.cs deleted file mode 100644 index 7a6bb71..0000000 --- a/PyroFetes/DTO/ProductDelivery/Request/UpdateProductDeliveryDto.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace PyroFetes.DTO.ProductDelivery.Request; - -public class UpdateProductDeliveryDto -{ - public int Quantity { get; set; } - public int ProductId { get; set; } - public int DeliveryNoteId { get; set; } -} \ No newline at end of file diff --git a/PyroFetes/DTO/ProductDelivery/Response/GetProductDeliveryDto.cs b/PyroFetes/DTO/ProductDelivery/Response/GetProductDeliveryDto.cs index 9fdbe04..92c78cf 100644 --- a/PyroFetes/DTO/ProductDelivery/Response/GetProductDeliveryDto.cs +++ b/PyroFetes/DTO/ProductDelivery/Response/GetProductDeliveryDto.cs @@ -14,15 +14,5 @@ public class GetProductDeliveryDto public string? ProductLink { get; set; } public int ProductMinimalQuantity { get; set; } - public int DeliveryNoteId { get; set; } - public string? DeliveryNoteTrackingNumber { get; set; } - public DateOnly DeliveryNoteEstimateDeliveryDate { get; set; } - public DateOnly DeliveryNoteExpeditionDate { get; set; } - public DateOnly? DeliveryNoteRealDeliveryDate { get; set; } - - public int DeliveryNoteDeliverId { get; set; } - public string? DeliveryNoteDeliverTransporter { get; set; } - - public int Quantity { get; set; } } \ No newline at end of file diff --git a/PyroFetes/DTO/PurchaseOrder/Response/GetPurchaseOrderDto.cs b/PyroFetes/DTO/PurchaseOrder/Response/GetPurchaseOrderDto.cs index 20dbe4e..f2d626a 100644 --- a/PyroFetes/DTO/PurchaseOrder/Response/GetPurchaseOrderDto.cs +++ b/PyroFetes/DTO/PurchaseOrder/Response/GetPurchaseOrderDto.cs @@ -6,5 +6,6 @@ public class GetPurchaseOrderDto { public int Id { get; set; } public string? PurchaseConditions { get; set; } + public int SupplierId { get; set; } public List? Products { get; set; } } \ No newline at end of file diff --git a/PyroFetes/DTO/PurchaseProduct/Request/CreatePurchaseProductDto.cs b/PyroFetes/DTO/PurchaseProduct/Request/CreatePurchaseProductDto.cs index 1249b41..f23dfb0 100644 --- a/PyroFetes/DTO/PurchaseProduct/Request/CreatePurchaseProductDto.cs +++ b/PyroFetes/DTO/PurchaseProduct/Request/CreatePurchaseProductDto.cs @@ -5,5 +5,4 @@ public class CreatePurchaseProductDto public int Quantity { get; set; } public int ProductId { get; set; } public int PurchaseOrderId { get; set; } - public string? PurchaseOrderPurchaseConditions { get; set; } } \ No newline at end of file diff --git a/PyroFetes/DTO/PurchaseProduct/Request/UpdatePurchaseProductDto.cs b/PyroFetes/DTO/PurchaseProduct/Request/UpdatePurchaseProductDto.cs deleted file mode 100644 index 8a718cb..0000000 --- a/PyroFetes/DTO/PurchaseProduct/Request/UpdatePurchaseProductDto.cs +++ /dev/null @@ -1,22 +0,0 @@ -namespace PyroFetes.DTO.PurchaseProduct.Request; - -public class UpdatePurchaseProductDto -{ - public int ProductId { get; set; } - public int PurchaseOrderId { get; set; } - - public int Quantity { get; set; } - - public string? ProductReferences { get; set; } - public string? ProductName { get; set; } - public decimal ProductDuration {get; set;} - public int ProductCaliber { get; set; } - public string? ProductApprovalNumber { get; set; } - public decimal ProductWeight { get; set; } - public decimal ProductNec { get; set; } - public string? ProductImage { get; set; } - public string? ProductLink { get; set; } - public int ProductMinimalQuantity { get; set; } - - public string? PurchaseOrderPurchaseConditions { get; set; } -} \ No newline at end of file diff --git a/PyroFetes/DTO/PurchaseProduct/Response/GetPurchaseProductDto.cs b/PyroFetes/DTO/PurchaseProduct/Response/GetPurchaseProductDto.cs index cdfc15e..e323395 100644 --- a/PyroFetes/DTO/PurchaseProduct/Response/GetPurchaseProductDto.cs +++ b/PyroFetes/DTO/PurchaseProduct/Response/GetPurchaseProductDto.cs @@ -3,7 +3,7 @@ namespace PyroFetes.DTO.PurchaseProduct.Response; public class GetPurchaseProductDto { public int ProductId { get; set; } - public string? ProductReferences { get; set; } + public string? ProductReference { get; set; } public string? ProductName { get; set; } public decimal ProductDuration {get; set;} public int ProductCaliber { get; set; } @@ -15,8 +15,5 @@ public class GetPurchaseProductDto public int ProductMinimalQuantity { get; set; } public decimal ProductPrice { get; set; } - public int PurchaseOrderId { get; set; } - public string? PurchaseOrderPurchaseConditions { get; set; } - public int Quantity { get; set; } } \ No newline at end of file diff --git a/PyroFetes/DTO/QuotationProduct/Request/CreateProductQuotationDto.cs b/PyroFetes/DTO/QuotationProduct/Request/CreateProductQuotationDto.cs index 51b0771..43bcca7 100644 --- a/PyroFetes/DTO/QuotationProduct/Request/CreateProductQuotationDto.cs +++ b/PyroFetes/DTO/QuotationProduct/Request/CreateProductQuotationDto.cs @@ -1,6 +1,5 @@ namespace PyroFetes.DTO.QuotationProduct.Request; -// Pour création global public class CreateProductQuotationDto { public int ProductId { get; set; } diff --git a/PyroFetes/DTO/QuotationProduct/Request/CreateQuotationProductDto.cs b/PyroFetes/DTO/QuotationProduct/Request/CreateQuotationProductDto.cs index a4e1e5a..c7abdcf 100644 --- a/PyroFetes/DTO/QuotationProduct/Request/CreateQuotationProductDto.cs +++ b/PyroFetes/DTO/QuotationProduct/Request/CreateQuotationProductDto.cs @@ -1,22 +1,8 @@ namespace PyroFetes.DTO.QuotationProduct.Request; -public class CreateQuotationProductDto +public class AddQuotationProductDto { public int Quantity { get; set; } - public int QuotationId { get; set; } - public string? QuotationMessage { get; set; } - public string? QuotationConditionsSale { get; set; } - public int ProductId { get; set; } - public int ProductReferences { get; set; } - public string? ProductName { get; set; } - public decimal ProductDuration {get; set;} - public int ProductCaliber { get; set; } - public string? ProductApprovalNumber { get; set; } - public decimal ProductWeight { get; set; } - public decimal ProductNec { get; set; } - public string? ProductImage { get; set; } - public string? ProductLink { get; set; } - public int ProductMinimalQuantity { get; set; } } \ No newline at end of file diff --git a/PyroFetes/DTO/QuotationProduct/Request/UpdateQuotationProductDto.cs b/PyroFetes/DTO/QuotationProduct/Request/UpdateQuotationProductDto.cs deleted file mode 100644 index a726136..0000000 --- a/PyroFetes/DTO/QuotationProduct/Request/UpdateQuotationProductDto.cs +++ /dev/null @@ -1,23 +0,0 @@ -namespace PyroFetes.DTO.QuotationProduct.Request; - -public class UpdateQuotationProductDto -{ - public int Id { get; set; } - public int Quantity { get; set; } - - public int QuotationId { get; set; } - public string? QuotationMessage { get; set; } - public string? QuotationConditionsSale { get; set; } - - public int ProductId { get; set; } - public int ProductReferences { get; set; } - public string? ProductName { get; set; } - public decimal ProductDuration {get; set;} - public int ProductCaliber { get; set; } - public string? ProductApprovalNumber { get; set; } - public decimal ProductWeight { get; set; } - public decimal ProductNec { get; set; } - public string? ProductImage { get; set; } - public string? ProductLink { get; set; } - public int ProductMinimalQuantity { get; set; } -} \ No newline at end of file diff --git a/PyroFetes/DTO/QuotationProduct/Response/GetQuotationProductDto.cs b/PyroFetes/DTO/QuotationProduct/Response/GetQuotationProductDto.cs index 86643f9..087e844 100644 --- a/PyroFetes/DTO/QuotationProduct/Response/GetQuotationProductDto.cs +++ b/PyroFetes/DTO/QuotationProduct/Response/GetQuotationProductDto.cs @@ -4,12 +4,8 @@ public class GetQuotationProductDto { public int Quantity { get; set; } - public int QuotationId { get; set; } - public string? QuotationMessage { get; set; } - public string? QuotationConditionsSale { get; set; } - public int ProductId { get; set; } - public string? ProductReferences { get; set; } + public string? ProductReference { get; set; } public string? ProductName { get; set; } public decimal ProductDuration {get; set;} public int ProductCaliber { get; set; } diff --git a/PyroFetes/DTO/SettingDTO/Request/CreateSettingDto.cs b/PyroFetes/DTO/SettingDTO/Request/CreateSettingDto.cs index 56146d3..35abce9 100644 --- a/PyroFetes/DTO/SettingDTO/Request/CreateSettingDto.cs +++ b/PyroFetes/DTO/SettingDTO/Request/CreateSettingDto.cs @@ -2,6 +2,6 @@ namespace PyroFetes.DTO.SettingDTO.Request; public class CreateSettingDto { - public string? ElectronicSignature { get; set; } - public string? Logo { get; set; } + public IFormFile? ElectronicSignature { get; set; } + public IFormFile? Logo { get; set; } } \ No newline at end of file diff --git a/PyroFetes/DTO/SettingDTO/Request/PatchSettingElectronicSignatureDto.cs b/PyroFetes/DTO/SettingDTO/Request/PatchSettingElectronicSignatureDto.cs index 44e567e..2240628 100644 --- a/PyroFetes/DTO/SettingDTO/Request/PatchSettingElectronicSignatureDto.cs +++ b/PyroFetes/DTO/SettingDTO/Request/PatchSettingElectronicSignatureDto.cs @@ -3,5 +3,5 @@ namespace PyroFetes.DTO.SettingDTO.Request; public class PatchSettingElectronicSignatureDto { public int Id { get; set; } - public string? ElectronicSignature { get; set; } + public IFormFile? ElectronicSignature { get; set; } } \ No newline at end of file diff --git a/PyroFetes/DTO/SettingDTO/Request/PatchSettingLogoDto.cs b/PyroFetes/DTO/SettingDTO/Request/PatchSettingLogoDto.cs index 58a952e..24963df 100644 --- a/PyroFetes/DTO/SettingDTO/Request/PatchSettingLogoDto.cs +++ b/PyroFetes/DTO/SettingDTO/Request/PatchSettingLogoDto.cs @@ -3,5 +3,5 @@ namespace PyroFetes.DTO.SettingDTO.Request; public class PatchSettingLogoDto { public int Id { get; set; } - public string? Logo { get; set; } + public IFormFile? Logo { get; set; } } \ No newline at end of file diff --git a/PyroFetes/DTO/Supplier/Response/GetSupplierDto.cs b/PyroFetes/DTO/Supplier/Response/GetSupplierDto.cs index 2edbe93..bea9b70 100644 --- a/PyroFetes/DTO/Supplier/Response/GetSupplierDto.cs +++ b/PyroFetes/DTO/Supplier/Response/GetSupplierDto.cs @@ -1,5 +1,4 @@ using PyroFetes.DTO.Price.Response; -using PyroFetes.DTO.Product.Response; namespace PyroFetes.DTO.Supplier.Response; @@ -13,6 +12,5 @@ public class GetSupplierDto public string? ZipCode { get; set; } public string? City { get; set; } public int DeliveryDelay { get; set; } - public List? Products { get; set; } public List? Prices { get; set; } } \ No newline at end of file diff --git a/PyroFetes/Endpoints/Deliverers/CreateDelivererEndpoint.cs b/PyroFetes/Endpoints/Deliverers/CreateDelivererEndpoint.cs index 4eabfa5..f531045 100644 --- a/PyroFetes/Endpoints/Deliverers/CreateDelivererEndpoint.cs +++ b/PyroFetes/Endpoints/Deliverers/CreateDelivererEndpoint.cs @@ -6,9 +6,7 @@ using PyroFetes.Repositories; namespace PyroFetes.Endpoints.Deliverers; -public class CreateDelivererEndpoint( - DeliverersRepository deliverersRepository, - AutoMapper.IMapper mapper) : Endpoint +public class CreateDelivererEndpoint(DeliverersRepository deliverersRepository) : Endpoint { public override void Configure() { @@ -18,13 +16,12 @@ public class CreateDelivererEndpoint( public override async Task HandleAsync(CreateDelivererDto req, CancellationToken ct) { - Deliverer newDeliverer = new Deliverer() + Deliverer newDeliverer = new() { Transporter = req.Transporter, }; await deliverersRepository.AddAsync(newDeliverer, ct); - - await Send.OkAsync(mapper.Map(newDeliverer), ct); + await Send.NoContentAsync(ct); } -} +} \ No newline at end of file diff --git a/PyroFetes/Endpoints/Deliverers/DeleteDelivererEndpoint.cs b/PyroFetes/Endpoints/Deliverers/DeleteDelivererEndpoint.cs index a2981fe..31ee092 100644 --- a/PyroFetes/Endpoints/Deliverers/DeleteDelivererEndpoint.cs +++ b/PyroFetes/Endpoints/Deliverers/DeleteDelivererEndpoint.cs @@ -9,28 +9,26 @@ public class DeleteDelivererRequest { public int DelivererId { get; set; } } + public class DeleteDelivererEndpoint(DeliverersRepository deliverersRepository) : Endpoint { public override void Configure() { - Delete("/deliverers/{@id}", x=>new {x.DelivererId}); + Delete("/deliverers/{@Id}", x => new { x.DelivererId }); AllowAnonymous(); - } public override async Task HandleAsync(DeleteDelivererRequest req, CancellationToken ct) { - Deliverer? deliverer = await deliverersRepository.FirstOrDefaultAsync(new GetDelivererByIdSpec(req.DelivererId), ct); + Deliverer? deliverer = await deliverersRepository.SingleOrDefaultAsync(new GetDelivererByIdSpec(req.DelivererId), ct); - if (deliverer == null) + if (deliverer is null) { await Send.NotFoundAsync(ct); return; } - + await deliverersRepository.DeleteAsync(deliverer, ct); - - await Send.OkAsync(ct); + await Send.NoContentAsync(ct); } - } \ No newline at end of file diff --git a/PyroFetes/Endpoints/Deliverers/GetAllDelivererEndpoint.cs b/PyroFetes/Endpoints/Deliverers/GetAllDelivererEndpoint.cs index 5710628..b30d02f 100644 --- a/PyroFetes/Endpoints/Deliverers/GetAllDelivererEndpoint.cs +++ b/PyroFetes/Endpoints/Deliverers/GetAllDelivererEndpoint.cs @@ -1,6 +1,4 @@ -using AutoMapper.QueryableExtensions; using FastEndpoints; -using Microsoft.EntityFrameworkCore; using PyroFetes.DTO.Deliverer.Response; using PyroFetes.Repositories; @@ -12,12 +10,10 @@ public class GetAllDelivererEndpoint(DeliverersRepository deliverersRepository) { Get("/deliverers"); AllowAnonymous(); - } public override async Task HandleAsync(CancellationToken ct) { await Send.OkAsync(await deliverersRepository.ProjectToListAsync(ct), ct); } - } \ No newline at end of file diff --git a/PyroFetes/Endpoints/Deliverers/GetDelivererEndpoint.cs b/PyroFetes/Endpoints/Deliverers/GetDelivererEndpoint.cs index 22a027f..640d0c2 100644 --- a/PyroFetes/Endpoints/Deliverers/GetDelivererEndpoint.cs +++ b/PyroFetes/Endpoints/Deliverers/GetDelivererEndpoint.cs @@ -1,5 +1,4 @@ using FastEndpoints; -using Microsoft.EntityFrameworkCore; using PyroFetes.DTO.Deliverer.Response; using PyroFetes.Models; using PyroFetes.Repositories; @@ -12,22 +11,19 @@ public class GetDelivererRequest public int DelivererId { get; set; } } -public class GetDelivererEndpoint( - DeliverersRepository deliverersRepository, - AutoMapper.IMapper mapper) : Endpoint +public class GetDelivererEndpoint(DeliverersRepository deliverersRepository, AutoMapper.IMapper mapper) : Endpoint { public override void Configure() { - Get("/deliverers/{@id}", x=>new {x.DelivererId}); + Get("/deliverers/{@Id}", x => new { x.DelivererId }); AllowAnonymous(); - } public override async Task HandleAsync(GetDelivererRequest req, CancellationToken ct) { - Deliverer? deliverer = await deliverersRepository.FirstOrDefaultAsync(new GetDelivererByIdSpec(req.DelivererId), ct); + Deliverer? deliverer = await deliverersRepository.SingleOrDefaultAsync(new GetDelivererByIdSpec(req.DelivererId), ct); - if (deliverer == null) + if (deliverer is null) { await Send.NotFoundAsync(ct); return; @@ -35,5 +31,4 @@ public class GetDelivererEndpoint( await Send.OkAsync(mapper.Map(deliverer), ct); } - } \ No newline at end of file diff --git a/PyroFetes/Endpoints/Deliverers/UpdateDelivererEndpoint.cs b/PyroFetes/Endpoints/Deliverers/UpdateDelivererEndpoint.cs index ebf153e..a9b38f5 100644 --- a/PyroFetes/Endpoints/Deliverers/UpdateDelivererEndpoint.cs +++ b/PyroFetes/Endpoints/Deliverers/UpdateDelivererEndpoint.cs @@ -1,5 +1,4 @@ using FastEndpoints; -using Microsoft.EntityFrameworkCore; using PyroFetes.DTO.Deliverer.Request; using PyroFetes.DTO.Deliverer.Response; using PyroFetes.Models; @@ -8,32 +7,27 @@ using PyroFetes.Specifications.Deliverers; namespace PyroFetes.Endpoints.Deliverers; -public class UpdateDelivererEndpoint( - DeliverersRepository deliverersRepository, - AutoMapper.IMapper mapper) : Endpoint +public class UpdateDelivererEndpoint(DeliverersRepository deliverersRepository, AutoMapper.IMapper mapper) : Endpoint { public override void Configure() { - Put("/deliverers/{@id}", x=>new {x.Id}); + Put("/deliverers/{@Id}", x => new { x.Id }); AllowAnonymous(); - } public override async Task HandleAsync(UpdateDelivererDto req, CancellationToken ct) { - Deliverer? deliverer = await deliverersRepository.FirstOrDefaultAsync(new GetDelivererByIdSpec(req.Id), ct); + Deliverer? deliverer = await deliverersRepository.SingleOrDefaultAsync(new GetDelivererByIdSpec(req.Id), ct); - if (deliverer == null) + if (deliverer is null) { await Send.NotFoundAsync(ct); return; } - - deliverer.Transporter = req.Transporter; - - await deliverersRepository.UpdateAsync(deliverer,ct); - await Send.OkAsync(mapper.Map(deliverer), ct); + mapper.Map(req, deliverer); + + await deliverersRepository.SaveChangesAsync(ct); + await Send.NoContentAsync(ct); } - } \ No newline at end of file diff --git a/PyroFetes/Endpoints/DeliveryNotes/CreateDeliveryNoteEndpoint.cs b/PyroFetes/Endpoints/DeliveryNotes/CreateDeliveryNoteEndpoint.cs index 63d3103..3266034 100644 --- a/PyroFetes/Endpoints/DeliveryNotes/CreateDeliveryNoteEndpoint.cs +++ b/PyroFetes/Endpoints/DeliveryNotes/CreateDeliveryNoteEndpoint.cs @@ -1,6 +1,5 @@ using FastEndpoints; using PyroFetes.DTO.DeliveryNote.Request; -using PyroFetes.DTO.DeliveryNote.Response; using PyroFetes.Models; using PyroFetes.Repositories; using PyroFetes.Specifications.Deliverers; @@ -12,8 +11,7 @@ public class CreateDeliveryNoteEndpoint( DeliveryNotesRepository deliveryNotesRepository, DeliverersRepository deliverersRepository, ProductsRepository productsRepository, - ProductDeliveriesRepository productDeliveriesRepository, - AutoMapper.IMapper mapper) : Endpoint + ProductDeliveriesRepository productDeliveriesRepository) : Endpoint { public override void Configure() { @@ -23,46 +21,44 @@ public class CreateDeliveryNoteEndpoint( public override async Task HandleAsync(CreateDeliveryNoteDto req, CancellationToken ct) { - Deliverer? deliverer = await deliverersRepository.FirstOrDefaultAsync(new GetDelivererByIdSpec(req.DelivererId), ct); - - if (deliverer == null) + Deliverer? deliverer = await deliverersRepository.SingleOrDefaultAsync(new GetDelivererByIdSpec(req.DelivererId), ct); + if (deliverer is null) { - await Send.StringAsync("No deliverer found", 404, cancellation: ct); + await Send.NotFoundAsync(ct); return; } - + //Creating the Delivery Note - DeliveryNote newDeliveryNote = new DeliveryNote() + DeliveryNote newDeliveryNote = new() { TrackingNumber = req.TrackingNumber, EstimateDeliveryDate = req.EstimateDeliveryDate, - ExpeditionDate = req.ExpeditionDate, - DelivererId = req.DelivererId, + ExpeditionDate = req.ExpeditionDate, + DelivererId = deliverer.Id, Deliverer = deliverer, - }; - + await deliveryNotesRepository.AddAsync(newDeliveryNote, ct); - foreach (var productQuantity in req.ProductQuantities!) + if (req.ProductQuantities is not null) { - Product? product = - await productsRepository.FirstOrDefaultAsync(new GetProductByIdSpec(productQuantity.Key), ct); - if (product != null) + foreach (KeyValuePair productQuantity in req.ProductQuantities) { - ProductDelivery productDelivery = new ProductDelivery() + Product? product = await productsRepository.SingleOrDefaultAsync(new GetProductByIdSpec(productQuantity.Key), ct); + if (product is null) continue; + ProductDelivery productDelivery = new() { DeliveryNote = newDeliveryNote, Quantity = productQuantity.Value, Product = product, + ProductId = product.Id, DeliveryNoteId = newDeliveryNote.Id }; - + await productDeliveriesRepository.AddAsync(productDelivery, ct); } - } - - await Send.OkAsync(mapper.Map(newDeliveryNote), ct); + + await Send.NoContentAsync(ct); } } \ No newline at end of file diff --git a/PyroFetes/Endpoints/DeliveryNotes/DeleteDeliveryNoteEndpoint.cs b/PyroFetes/Endpoints/DeliveryNotes/DeleteDeliveryNoteEndpoint.cs index 4fe7644..bc14d89 100644 --- a/PyroFetes/Endpoints/DeliveryNotes/DeleteDeliveryNoteEndpoint.cs +++ b/PyroFetes/Endpoints/DeliveryNotes/DeleteDeliveryNoteEndpoint.cs @@ -1,9 +1,7 @@ using FastEndpoints; -using PyroFetes.Endpoints.Quotations; using PyroFetes.Models; using PyroFetes.Repositories; using PyroFetes.Specifications.DeliveryNotes; -using PyroFetes.Specifications.Quotations; namespace PyroFetes.Endpoints.DeliveryNotes; @@ -17,22 +15,21 @@ public class DeleteDeliveryNoteEndpoint( { public override void Configure() { - Delete("/deliveryNotes/{@Id}", x => new {x.Id}); + Delete("/deliveryNotes/{@Id}", x => new { x.Id }); AllowAnonymous(); } public override async Task HandleAsync(DeleteDeliveryNoteRequest req, CancellationToken ct) { - DeliveryNote? deliveryNote = await deliveryNotesRepository.FirstOrDefaultAsync(new GetDeliveryNoteByIdSpec(req.Id), ct); + DeliveryNote? deliveryNote = await deliveryNotesRepository.SingleOrDefaultAsync(new GetDeliveryNoteByIdSpec(req.Id), ct); - if (deliveryNote == null) + if (deliveryNote is null) { await Send.NotFoundAsync(ct); return; } - + await deliveryNotesRepository.DeleteAsync(deliveryNote, ct); - await Send.NoContentAsync(ct); } } \ No newline at end of file diff --git a/PyroFetes/Endpoints/DeliveryNotes/GetAllDeliveryNoteEndpoint.cs b/PyroFetes/Endpoints/DeliveryNotes/GetAllDeliveryNoteEndpoint.cs index 7e126b8..56c19c6 100644 --- a/PyroFetes/Endpoints/DeliveryNotes/GetAllDeliveryNoteEndpoint.cs +++ b/PyroFetes/Endpoints/DeliveryNotes/GetAllDeliveryNoteEndpoint.cs @@ -1,6 +1,7 @@ using FastEndpoints; using PyroFetes.DTO.DeliveryNote.Response; using PyroFetes.Repositories; +using PyroFetes.Specifications.DeliveryNotes; namespace PyroFetes.Endpoints.DeliveryNotes; @@ -14,7 +15,6 @@ public class GetAllDeliveryNoteEndpoint(DeliveryNotesRepository deliveryNotesRep public override async Task HandleAsync(CancellationToken ct) { - await Send.OkAsync(await deliveryNotesRepository.ProjectToListAsync(ct), ct); + await Send.OkAsync(await deliveryNotesRepository.ProjectToListAsync(new GetAllDeliveryNoteSpec() ,ct), ct); } - } \ No newline at end of file diff --git a/PyroFetes/Endpoints/DeliveryNotes/GetDeliveryNoteEndpoint.cs b/PyroFetes/Endpoints/DeliveryNotes/GetDeliveryNoteEndpoint.cs index 90f3387..62597db 100644 --- a/PyroFetes/Endpoints/DeliveryNotes/GetDeliveryNoteEndpoint.cs +++ b/PyroFetes/Endpoints/DeliveryNotes/GetDeliveryNoteEndpoint.cs @@ -10,26 +10,27 @@ public class GetDeliveryNoteRequest { public int DeliveryNoteId { get; set; } } + public class GetDeliveryNoteEndpoint( DeliveryNotesRepository deliveryNotesRepository, AutoMapper.IMapper mapper) : Endpoint { public override void Configure() { - Get("/deliveryNotes/{@id}", x=> new {x.DeliveryNoteId}); + Get("/deliveryNotes/{@Id}", x => new { x.DeliveryNoteId }); AllowAnonymous(); } public override async Task HandleAsync(GetDeliveryNoteRequest req, CancellationToken ct) { - DeliveryNote? deliveryNote = await deliveryNotesRepository.FirstOrDefaultAsync(new GetDeliveryNoteByIdSpec(req.DeliveryNoteId), ct); + DeliveryNote? deliveryNote = await deliveryNotesRepository.SingleOrDefaultAsync(new GetDeliveryNoteByIdSpec(req.DeliveryNoteId), ct); - if (deliveryNote == null) + if (deliveryNote is null) { await Send.NotFoundAsync(ct); return; } - + await Send.OkAsync(mapper.Map(deliveryNote), ct); } } \ No newline at end of file diff --git a/PyroFetes/Endpoints/DeliveryNotes/GetDeliveryNotePdfEndpoint.cs b/PyroFetes/Endpoints/DeliveryNotes/GetDeliveryNotePdfEndpoint.cs index 76bbbab..19b47d1 100644 --- a/PyroFetes/Endpoints/DeliveryNotes/GetDeliveryNotePdfEndpoint.cs +++ b/PyroFetes/Endpoints/DeliveryNotes/GetDeliveryNotePdfEndpoint.cs @@ -5,39 +5,37 @@ using PyroFetes.Models; using PyroFetes.Repositories; using PyroFetes.Services.Pdf; using PyroFetes.Specifications.DeliveryNotes; -using PyroFetes.Specifications.Quotations; namespace PyroFetes.Endpoints.DeliveryNotes; -public class GetDeliveryNotePdfEndpoint( - DeliveryNotesRepository deliveryNotesRepository, - IDeliveryNotePdfService deliveryNotePdfService) - : Endpoint +public class GetDeliveryNotePdfEndpoint(DeliveryNotesRepository deliveryNotesRepository, IDeliveryNotePdfService deliveryNotePdfService, SettingsRepository settingsRepository) : Endpoint { public override void Configure() { - Get("/deliveryNotes/{@Id}/pdf", x => new {x.Id}); + Get("/deliveryNotes/{@Id}/pdf", x => new { x.Id }); AllowAnonymous(); Description(b => b.Produces(200, MediaTypeNames.Application.Pdf)); } - + public override async Task HandleAsync(GetDeliveryNotePdfDto req, CancellationToken ct) { DeliveryNote? deliveryNote = await deliveryNotesRepository - .FirstOrDefaultAsync(new GetDeliveryNoteByIdWithProductsSpec(req.Id), ct); + .SingleOrDefaultAsync(new GetDeliveryNoteByIdWithProductsSpec(req.Id), ct); - if (deliveryNote == null) + Setting? setting = await settingsRepository.FirstOrDefaultAsync(ct); + + if (deliveryNote is null) { await Send.NotFoundAsync(ct); return; } - - var bytes = deliveryNotePdfService.Generate(deliveryNote, deliveryNote.ProductDeliveries!); + + byte[] bytes = deliveryNotePdfService.Generate(deliveryNote, deliveryNote.ProductDeliveries!, setting!); await Send.BytesAsync( bytes: bytes, contentType: "application/pdf", - fileName: $"bon-de-livraison-{deliveryNote.Id}.pdf", + fileName: $"bon-de-livraison-{deliveryNote.Id}{DateOnly.FromDateTime(DateTime.Now)}.pdf", cancellation: ct); } } \ No newline at end of file diff --git a/PyroFetes/Endpoints/DeliveryNotes/PatchRealDeliveryDateEndpoint.cs b/PyroFetes/Endpoints/DeliveryNotes/PatchRealDeliveryDateEndpoint.cs index 99c35c1..a710044 100644 --- a/PyroFetes/Endpoints/DeliveryNotes/PatchRealDeliveryDateEndpoint.cs +++ b/PyroFetes/Endpoints/DeliveryNotes/PatchRealDeliveryDateEndpoint.cs @@ -1,45 +1,41 @@ using FastEndpoints; using PyroFetes.DTO.DeliveryNote.Request; -using PyroFetes.DTO.DeliveryNote.Response; -using PyroFetes.DTO.PurchaseProduct.Request; using PyroFetes.Models; using PyroFetes.Repositories; -using PyroFetes.Specifications.Deliverers; using PyroFetes.Specifications.DeliveryNotes; namespace PyroFetes.Endpoints.DeliveryNotes; public class PatchRealDeliveryDateEndpoint( DeliveryNotesRepository deliveryNotesRepository, - AutoMapper.IMapper mapper) : Endpoint + AutoMapper.IMapper mapper) : Endpoint { public override void Configure() { - Patch("/deliveryNotes/{@id}", x=> new {x.Id}); + Patch("/deliveryNotes/{@Id}", x => new { x.Id }); AllowAnonymous(); } public override async Task HandleAsync(PatchDeliveryNoteRealDeliveryDateDto req, CancellationToken ct) { - DeliveryNote? deliveryNoteToPath = - await deliveryNotesRepository.FirstOrDefaultAsync(new GetDeliveryNoteByIdSpec(req.Id),ct); + DeliveryNote? deliveryNoteToPath = await deliveryNotesRepository.SingleOrDefaultAsync(new GetDeliveryNoteByIdSpec(req.Id), ct); - if (deliveryNoteToPath == null) + if (deliveryNoteToPath is null) { await Send.NotFoundAsync(ct); return; } - - if (deliveryNoteToPath.RealDeliveryDate != null) + + if (deliveryNoteToPath.RealDeliveryDate is not null) { - await Send.StringAsync("Impossible de modifier la date.", 400); + await Send.StringAsync("Impossible de modifier la date.", 400, cancellation: ct); return; } - - deliveryNoteToPath.RealDeliveryDate = req.RealDeliveryDate; - + + mapper.Map(req, deliveryNoteToPath); + await deliveryNotesRepository.UpdateAsync(deliveryNoteToPath, ct); - - await Send.OkAsync(mapper.Map(deliveryNoteToPath), ct); + + await Send.NoContentAsync(ct); } } \ No newline at end of file diff --git a/PyroFetes/Endpoints/DeliveryNotes/UpdateDeliveryNoteEndpoint.cs b/PyroFetes/Endpoints/DeliveryNotes/UpdateDeliveryNoteEndpoint.cs index 5d347cb..6fccf9b 100644 --- a/PyroFetes/Endpoints/DeliveryNotes/UpdateDeliveryNoteEndpoint.cs +++ b/PyroFetes/Endpoints/DeliveryNotes/UpdateDeliveryNoteEndpoint.cs @@ -1,40 +1,32 @@ using FastEndpoints; using PyroFetes.DTO.DeliveryNote.Request; -using PyroFetes.DTO.DeliveryNote.Response; using PyroFetes.Models; using PyroFetes.Repositories; using PyroFetes.Specifications.DeliveryNotes; namespace PyroFetes.Endpoints.DeliveryNotes; -public class UpdateDeliveryNoteEndpoint( - DeliveryNotesRepository deliveryNotesRepository, - AutoMapper.IMapper mapper) : Endpoint +public class UpdateDeliveryNoteEndpoint(DeliveryNotesRepository deliveryNotesRepository, AutoMapper.IMapper mapper) : Endpoint { public override void Configure() { - Put("/deliveryNotes/{@Id}", x => new {x.Id}); + Put("/deliveryNotes/{@Id}", x => new { x.Id }); AllowAnonymous(); } public override async Task HandleAsync(UpdateDeliveryNoteDto req, CancellationToken ct) { - DeliveryNote? deliveryNote = await deliveryNotesRepository.FirstOrDefaultAsync(new GetDeliveryNoteByIdSpec(req.Id), ct); - - if (deliveryNote == null) + DeliveryNote? deliveryNote = await deliveryNotesRepository.SingleOrDefaultAsync(new GetDeliveryNoteByIdSpec(req.Id), ct); + + if (deliveryNote is null) { await Send.NotFoundAsync(ct); return; } - - deliveryNote.TrackingNumber = req.TrackingNumber; - deliveryNote.EstimateDeliveryDate = req.EstimateDeliveryDate; - deliveryNote.ExpeditionDate = req.ExpeditionDate; - deliveryNote.RealDeliveryDate = req.RealDeliveryDate; - deliveryNote.DelivererId = req.DelivererId; - - await deliveryNotesRepository.UpdateAsync(deliveryNote, ct); - - await Send.OkAsync(mapper.Map(deliveryNote), ct); + + mapper.Map(req, deliveryNote); + + await deliveryNotesRepository.SaveChangesAsync(ct); + await Send.NoContentAsync(ct); } } \ No newline at end of file diff --git a/PyroFetes/Endpoints/Prices/CreatePriceEndpoint.cs b/PyroFetes/Endpoints/Prices/CreatePriceEndpoint.cs deleted file mode 100644 index 5445c0d..0000000 --- a/PyroFetes/Endpoints/Prices/CreatePriceEndpoint.cs +++ /dev/null @@ -1,84 +0,0 @@ -using FastEndpoints; -using PyroFetes.DTO.Price.Request; -using PyroFetes.DTO.Price.Response; -using PyroFetes.Models; -using PyroFetes.Repositories; -using PyroFetes.Specifications.Prices; -using PyroFetes.Specifications.Products; -using PyroFetes.Specifications.Suppliers; - -namespace PyroFetes.Endpoints.Prices; - -public class CreatePriceEndpoint( - SuppliersRepository suppliersRepository, - ProductsRepository productsRepository, - PricesRepository pricesRepository, - AutoMapper.IMapper mapper) : Endpoint -{ - public override void Configure() - { - Post("/prices"); - AllowAnonymous(); - } - - public override async Task HandleAsync(CreatePriceDto req, CancellationToken ct) - { - // Gestion du fournisseur - Supplier? supplier = await suppliersRepository.FirstOrDefaultAsync(new GetSupplierByIdSpec(req.SupplierId), ct); - if (supplier == null) - { - supplier = new Supplier() - { - Name = req.SupplierName, - Email = req.SupplierEmail, - Phone = req.SupplierPhone, - Address = req.SupplierAddress, - City = req.SupplierCity, - ZipCode = req.SupplierZipCode, - DeliveryDelay = req.SupplierDeliveryDelay - }; - await suppliersRepository.AddAsync(supplier, ct); - } - - // Gestion du produit - Product? product = await productsRepository.FirstOrDefaultAsync(new GetProductByIdSpec(req.ProductId), ct); - if (product == null) - { - product = new Product() - { - Reference = req.ProductReferences, - Name = req.ProductName, - Duration = req.ProductDuration, - Caliber = req.ProductCaliber, - ApprovalNumber = req.ProductApprovalNumber, - Weight = req.ProductWeight, - Nec = req.ProductNec, - Image = req.ProductImage, - Link = req.ProductLink, - MinimalQuantity = req.ProductMinimalQuantity - }; - await productsRepository.AddAsync(product, ct); - } - - // Vérifie si le prix existe déjà pour ce fournisseur et produit - Price? existingPrice = await pricesRepository.FirstOrDefaultAsync(new GetPriceByProductIdAndSupplierIdSpec(req.ProductId, req.SupplierId), ct); - - if (existingPrice != null) - { - await Send.StringAsync("Le fournisseur a déjà un prix pour ce produit.", 400, cancellation: ct); - return; - } - - // Création du prix - var priceAdded = new Price() - { - SellingPrice = req.SellingPrice, - SupplierId = supplier.Id, - ProductId = product.Id - }; - await pricesRepository.AddAsync(priceAdded, ct); - - - await Send.OkAsync(mapper.Map(priceAdded), ct); - } -} diff --git a/PyroFetes/Endpoints/Products/DeleteProductEndpoint.cs b/PyroFetes/Endpoints/Products/DeleteProductEndpoint.cs index 1e48163..a772064 100644 --- a/PyroFetes/Endpoints/Products/DeleteProductEndpoint.cs +++ b/PyroFetes/Endpoints/Products/DeleteProductEndpoint.cs @@ -1,8 +1,6 @@ using FastEndpoints; -using PyroFetes.Endpoints.Deliverers; using PyroFetes.Models; using PyroFetes.Repositories; -using PyroFetes.Specifications.Deliverers; using PyroFetes.Specifications.Products; namespace PyroFetes.Endpoints.Products; @@ -11,28 +9,26 @@ public class DeleteProductsRequest { public int ProductId { get; set; } } + public class DeleteProductEndpoint(ProductsRepository productsRepository) : Endpoint { public override void Configure() { - Delete("/products/{@id}", x=>new {x.ProductId}); + Delete("/products/{@Id}", x => new { x.ProductId }); AllowAnonymous(); - } public override async Task HandleAsync(DeleteProductsRequest req, CancellationToken ct) { - Product? product = await productsRepository.FirstOrDefaultAsync(new GetProductByIdSpec(req.ProductId), ct); + Product? product = await productsRepository.SingleOrDefaultAsync(new GetProductByIdSpec(req.ProductId), ct); - if (product == null) + if (product is null) { await Send.NotFoundAsync(ct); return; } - - await productsRepository.DeleteAsync(product, ct); + await productsRepository.DeleteAsync(product, ct); await Send.OkAsync(ct); } - } \ No newline at end of file diff --git a/PyroFetes/Endpoints/Products/GetAllProductsEndpoint.cs b/PyroFetes/Endpoints/Products/GetAllProductsEndpoint.cs index 6b4f2e0..e6c9343 100644 --- a/PyroFetes/Endpoints/Products/GetAllProductsEndpoint.cs +++ b/PyroFetes/Endpoints/Products/GetAllProductsEndpoint.cs @@ -1,7 +1,5 @@ using FastEndpoints; -using Microsoft.EntityFrameworkCore; using PyroFetes.DTO.Product.Response; -using PyroFetes.Models; using PyroFetes.Repositories; namespace PyroFetes.Endpoints.Products; diff --git a/PyroFetes/Endpoints/Products/GetAllProductsUnderLimitEndpoint.cs b/PyroFetes/Endpoints/Products/GetAllProductsUnderLimitEndpoint.cs index 2057c35..0b9768f 100644 --- a/PyroFetes/Endpoints/Products/GetAllProductsUnderLimitEndpoint.cs +++ b/PyroFetes/Endpoints/Products/GetAllProductsUnderLimitEndpoint.cs @@ -1,4 +1,3 @@ -using AutoMapper; using FastEndpoints; using PyroFetes.DTO.Product.Response; using PyroFetes.Repositories; @@ -15,7 +14,7 @@ public class GetAllProductsUnderLimitEndpoint(ProductsRepository productsReposit } public override async Task HandleAsync(CancellationToken ct) - { + { await Send.OkAsync(await productsRepository.ProjectToListAsync(new GetProductsUnderLimitSpec(), ct), ct); } } \ No newline at end of file diff --git a/PyroFetes/Endpoints/Products/GetProductEndpoint.cs b/PyroFetes/Endpoints/Products/GetProductEndpoint.cs index 705f5d2..efe2a7b 100644 --- a/PyroFetes/Endpoints/Products/GetProductEndpoint.cs +++ b/PyroFetes/Endpoints/Products/GetProductEndpoint.cs @@ -1,5 +1,4 @@ using FastEndpoints; -using Microsoft.EntityFrameworkCore; using PyroFetes.DTO.Product.Response; using PyroFetes.Models; using PyroFetes.Repositories; @@ -18,7 +17,7 @@ public class GetProductEndpoint( { public override void Configure() { - Get("/products/{@Id}", x => new {x.Id}); + Get("/products/{@Id}", x => new { x.Id }); AllowAnonymous(); } @@ -26,12 +25,12 @@ public class GetProductEndpoint( { Product? product = await productsRepository.FirstOrDefaultAsync(new GetProductByIdSpec(req.Id), ct); - if (product == null) + if (product is null) { await Send.NotFoundAsync(ct); return; } - - await Send.OkAsync(mapper.Map(product), ct); + + await Send.OkAsync(mapper.Map(product), ct); } } \ No newline at end of file diff --git a/PyroFetes/Endpoints/Products/PatchProductMinimalStockEndpoint.cs b/PyroFetes/Endpoints/Products/PatchProductMinimalStockEndpoint.cs index 6d2cf8b..40ebeba 100644 --- a/PyroFetes/Endpoints/Products/PatchProductMinimalStockEndpoint.cs +++ b/PyroFetes/Endpoints/Products/PatchProductMinimalStockEndpoint.cs @@ -1,16 +1,12 @@ using FastEndpoints; -using Microsoft.EntityFrameworkCore; using PyroFetes.DTO.Product.Request; -using PyroFetes.DTO.Product.Response; using PyroFetes.Models; using PyroFetes.Repositories; using PyroFetes.Specifications.Products; namespace PyroFetes.Endpoints.Products; -public class PatchProductMinimalStockEndpoint( - ProductsRepository productsRepository, - AutoMapper.IMapper mapper) : Endpoint +public class PatchProductMinimalStockEndpoint(ProductsRepository productsRepository, AutoMapper.IMapper mapper) : Endpoint { public override void Configure() { @@ -20,17 +16,17 @@ public class PatchProductMinimalStockEndpoint( public override async Task HandleAsync(PatchProductMinimalStockDto req, CancellationToken ct) { - Product? product = await productsRepository.FirstOrDefaultAsync(new GetProductByIdSpec(req.Id), ct); - - if (product == null) + Product? product = await productsRepository.SingleOrDefaultAsync(new GetProductByIdSpec(req.Id), ct); + + if (product is null) { await Send.NotFoundAsync(ct); return; } - product.MinimalQuantity = req.MinimalQuantity; + mapper.Map(req, product); + await productsRepository.UpdateAsync(product, ct); - - await Send.OkAsync(mapper.Map(product), ct); + await Send.NoContentAsync(ct); } } \ No newline at end of file diff --git a/PyroFetes/Endpoints/Products/UpdateProductEndpoint.cs b/PyroFetes/Endpoints/Products/UpdateProductEndpoint.cs index 0b37aa9..81fccdd 100644 --- a/PyroFetes/Endpoints/Products/UpdateProductEndpoint.cs +++ b/PyroFetes/Endpoints/Products/UpdateProductEndpoint.cs @@ -1,46 +1,32 @@ using FastEndpoints; -using Microsoft.EntityFrameworkCore; using PyroFetes.DTO.Product.Request; -using PyroFetes.DTO.Product.Response; using PyroFetes.Models; using PyroFetes.Repositories; using PyroFetes.Specifications.Products; namespace PyroFetes.Endpoints.Products; -public class UpdateProductEndpoint( - ProductsRepository productsRepository, - AutoMapper.IMapper mapper) : Endpoint +public class UpdateProductEndpoint(ProductsRepository productsRepository, AutoMapper.IMapper mapper) : Endpoint { public override void Configure() { - Put("/products/{@Id}", x => new {x.Id}); + Put("/products/{@Id}", x => new { x.Id }); AllowAnonymous(); } public override async Task HandleAsync(UpdateProductDto req, CancellationToken ct) { - Product? product = await productsRepository.FirstOrDefaultAsync(new GetProductByIdSpec(req.Id), ct); - - if (product == null) + Product? product = await productsRepository.SingleOrDefaultAsync(new GetProductByIdSpec(req.Id), ct); + + if (product is null) { await Send.NotFoundAsync(ct); return; } - product.Reference = req.References; - product.Name = req.Name; - product.Duration = req.Duration; - product.Caliber = req.Caliber; - product.ApprovalNumber = req.ApprovalNumber; - product.Weight = req.Weight; - product.Nec = req.Nec; - product.Image = req.Image; - product.Link = req.Link; - product.MinimalQuantity = req.MinimalQuantity; - + mapper.Map(req, product); + await productsRepository.UpdateAsync(product, ct); - - await Send.OkAsync(mapper.Map(product), ct); + await Send.NoContentAsync(ct); } } \ No newline at end of file diff --git a/PyroFetes/Endpoints/PurchaseOrders/AddProductFromPurchaseOrderEndpoint.cs b/PyroFetes/Endpoints/PurchaseOrders/AddProductFromPurchaseOrderEndpoint.cs new file mode 100644 index 0000000..9a02d20 --- /dev/null +++ b/PyroFetes/Endpoints/PurchaseOrders/AddProductFromPurchaseOrderEndpoint.cs @@ -0,0 +1,32 @@ +using FastEndpoints; +using PyroFetes.DTO.PurchaseProduct.Request; +using PyroFetes.Models; +using PyroFetes.Repositories; +using PyroFetes.Specifications.PurchaseProducts; + +namespace PyroFetes.Endpoints.PurchaseOrders; + +public class AddProductFromPurchaseOrderEndpoint(PurchaseProductsRepository purchaseProductsRepository, AutoMapper.IMapper mapper) : Endpoint +{ + public override void Configure() + { + Post("/purchaseOrders/{@PurchaseOrderId}/{@ProductId}", x => new { x.PurchaseOrderId, x.ProductId }); + AllowAnonymous(); + } + + public override async Task HandleAsync(CreatePurchaseProductDto req, CancellationToken ct) + { + PurchaseProduct? purchaseOrderProduct = + await purchaseProductsRepository.SingleOrDefaultAsync(new GetPurchaseProductByProductIdAndPurchaseOrderIdSpec(req.ProductId, req.PurchaseOrderId), ct); + if (purchaseOrderProduct is not null) + { + await Send.StringAsync("Le produit est déjà dans le bon de commande", 400, cancellation: ct); + return; + } + + purchaseOrderProduct = mapper.Map(req); + + await purchaseProductsRepository.AddAsync(purchaseOrderProduct, ct); + await Send.NoContentAsync(ct); + } +} \ No newline at end of file diff --git a/PyroFetes/Endpoints/PurchaseOrders/CreatePurchaseOrder.cs b/PyroFetes/Endpoints/PurchaseOrders/CreatePurchaseOrder.cs index b3ca875..b30ec5d 100644 --- a/PyroFetes/Endpoints/PurchaseOrders/CreatePurchaseOrder.cs +++ b/PyroFetes/Endpoints/PurchaseOrders/CreatePurchaseOrder.cs @@ -1,19 +1,18 @@ using FastEndpoints; using PyroFetes.DTO.PurchaseOrder.Request; -using PyroFetes.DTO.PurchaseOrder.Response; using PyroFetes.DTO.PurchaseProduct.Request; -using PyroFetes.DTO.PurchaseProduct.Response; using PyroFetes.Models; using PyroFetes.Repositories; using PyroFetes.Specifications.Products; -using PyroFetes.Specifications.PurchaseOrders; +using PyroFetes.Specifications.PurchaseProducts; namespace PyroFetes.Endpoints.PurchaseOrders; public class CreatePurchaseOrder( PurchaseOrdersRepository purchaseOrdersRepository, ProductsRepository productsRepository, - AutoMapper.IMapper mapper) : Endpoint + PurchaseProductsRepository purchaseProductsRepository, + AutoMapper.IMapper mapper) : Endpoint { public override void Configure() { @@ -23,30 +22,35 @@ public class CreatePurchaseOrder( public override async Task HandleAsync(CreatePurchaseOrderDto req, CancellationToken ct) { - PurchaseOrder purchaseOrder = new PurchaseOrder - { - PurchaseConditions = req.PurchaseConditions ?? "Conditions non précisées", - PurchaseProducts = new List() - }; + PurchaseOrder purchaseOrder = mapper.Map(req); - foreach (var line in req.Products) + if (req.Products != null) { - var product = await productsRepository.GetByIdAsync(line.ProductId, ct); - if (product == null) + foreach (CreatePurchaseOrderProductDto line in req.Products) { - await Send.NotFoundAsync(ct); - return; + Product? product = await productsRepository.SingleOrDefaultAsync(new GetProductByIdSpec(line.ProductId), ct); + if (product is null) + { + await Send.NotFoundAsync(ct); + return; + } + + PurchaseProduct? purchaseProduct = + await purchaseProductsRepository.SingleOrDefaultAsync(new GetPurchaseProductByProductIdAndPurchaseOrderIdSpec(line.ProductId, purchaseOrder.Id), ct); + + if (purchaseProduct is not null) + { + await Send.StringAsync("Le produit est déjà dans le bon de commande", 400, cancellation: ct); + } + + PurchaseProduct? productOnPurchase = mapper.Map(line); + productOnPurchase.PurchaseOrderId = purchaseOrder.Id; + + await purchaseProductsRepository.AddAsync(productOnPurchase, ct); } - - purchaseOrder.PurchaseProducts.Add(new PurchaseProduct - { - ProductId = product.Id, - Quantity = line.Quantity, - }); } await purchaseOrdersRepository.AddAsync(purchaseOrder, ct); - - await Send.OkAsync(mapper.Map(purchaseOrder), ct); + await Send.NoContentAsync(ct); } } \ No newline at end of file diff --git a/PyroFetes/Endpoints/PurchaseProducts/DeletePurchaseProductEndpoint.cs b/PyroFetes/Endpoints/PurchaseOrders/DeleteProductFromPurchaseOrderEndpoint.cs similarity index 51% rename from PyroFetes/Endpoints/PurchaseProducts/DeletePurchaseProductEndpoint.cs rename to PyroFetes/Endpoints/PurchaseOrders/DeleteProductFromPurchaseOrderEndpoint.cs index 7ce0dff..8f6274e 100644 --- a/PyroFetes/Endpoints/PurchaseProducts/DeletePurchaseProductEndpoint.cs +++ b/PyroFetes/Endpoints/PurchaseOrders/DeleteProductFromPurchaseOrderEndpoint.cs @@ -1,10 +1,9 @@ using FastEndpoints; -using Microsoft.EntityFrameworkCore; using PyroFetes.Models; using PyroFetes.Repositories; using PyroFetes.Specifications.PurchaseProducts; -namespace PyroFetes.Endpoints.PurchaseProducts; +namespace PyroFetes.Endpoints.PurchaseOrders; public class DeletePurchaseProductRequest { @@ -12,27 +11,26 @@ public class DeletePurchaseProductRequest public int PurchaseOrderId { get; set; } } -public class DeletePurchaseProductEndpoint(PurchaseProductsRepository purchaseProductsRepository) : Endpoint +public class DeleteProductFromPurchaseOrderEndpoint(PurchaseProductsRepository purchaseProductsRepository) : Endpoint { public override void Configure() { - Delete("/purchaseProducts/{@ProductId}/{@PurchaseOrderId}", x => new {x.ProductId, x.PurchaseOrderId}); + Delete("/purchaseOrders/{@ProductId}/{@PurchaseOrderId}", x => new { x.ProductId, x.PurchaseOrderId }); AllowAnonymous(); } public override async Task HandleAsync(DeletePurchaseProductRequest req, CancellationToken ct) { - PurchaseProduct? purchaseProduct = await purchaseProductsRepository.FirstOrDefaultAsync( - new GetPurchaseProductByProductIdAndPurchaseOrderIdSpec(req.ProductId, req.PurchaseOrderId), ct); + PurchaseProduct? purchaseProduct = + await purchaseProductsRepository.SingleOrDefaultAsync(new GetPurchaseProductByProductIdAndPurchaseOrderIdSpec(req.ProductId, req.PurchaseOrderId), ct); - if (purchaseProduct == null) + if (purchaseProduct is null) { await Send.NotFoundAsync(ct); return; } - + await purchaseProductsRepository.DeleteAsync(purchaseProduct, ct); - await Send.NoContentAsync(ct); } } \ No newline at end of file diff --git a/PyroFetes/Endpoints/PurchaseOrders/DeletePurchaseOrderEndpoint.cs b/PyroFetes/Endpoints/PurchaseOrders/DeletePurchaseOrderEndpoint.cs index 580efb6..b3f077c 100644 --- a/PyroFetes/Endpoints/PurchaseOrders/DeletePurchaseOrderEndpoint.cs +++ b/PyroFetes/Endpoints/PurchaseOrders/DeletePurchaseOrderEndpoint.cs @@ -1,5 +1,4 @@ using FastEndpoints; -using Microsoft.EntityFrameworkCore; using PyroFetes.Models; using PyroFetes.Repositories; using PyroFetes.Specifications.PurchaseOrders; @@ -11,13 +10,11 @@ public class DeletePurchaseOrderRequest public int Id { get; set; } } -public class DeletePurchaseOrderEndpoint( - PurchaseOrdersRepository purchaseOrdersRepository, - PurchaseProductsRepository purchaseProductsRepository) : Endpoint +public class DeletePurchaseOrderEndpoint(PurchaseOrdersRepository purchaseOrdersRepository) : Endpoint { public override void Configure() { - Delete("/purchaseOrders/{@Id}", x => new {x.Id}); + Delete("/purchaseOrders/{@Id}", x => new { x.Id }); AllowAnonymous(); } @@ -25,19 +22,13 @@ public class DeletePurchaseOrderEndpoint( { PurchaseOrder? purchaseOrder = await purchaseOrdersRepository.FirstOrDefaultAsync(new GetPurchaseOrderByIdSpec(req.Id), ct); - if (purchaseOrder == null) + if (purchaseOrder is null) { await Send.NotFoundAsync(ct); return; } - - if (purchaseOrder.PurchaseProducts != null && purchaseOrder.PurchaseProducts.Any()) - { - await purchaseProductsRepository.DeleteRangeAsync(purchaseOrder.PurchaseProducts, ct); - } - - await purchaseOrdersRepository.DeleteAsync(purchaseOrder, ct); - + + await purchaseOrdersRepository.DeleteAsync(purchaseOrder, ct); await Send.NoContentAsync(ct); } } \ No newline at end of file diff --git a/PyroFetes/Endpoints/PurchaseOrders/GetAllPurchaseOrderEndpoint.cs b/PyroFetes/Endpoints/PurchaseOrders/GetAllPurchaseOrderEndpoint.cs index 4bfd012..8a3dd58 100644 --- a/PyroFetes/Endpoints/PurchaseOrders/GetAllPurchaseOrderEndpoint.cs +++ b/PyroFetes/Endpoints/PurchaseOrders/GetAllPurchaseOrderEndpoint.cs @@ -1,7 +1,5 @@ using FastEndpoints; -using Microsoft.EntityFrameworkCore; using PyroFetes.DTO.PurchaseOrder.Response; -using PyroFetes.DTO.PurchaseProduct.Response; using PyroFetes.Repositories; namespace PyroFetes.Endpoints.PurchaseOrders; diff --git a/PyroFetes/Endpoints/PurchaseOrders/GetPurchaseOrderEndpoint.cs b/PyroFetes/Endpoints/PurchaseOrders/GetPurchaseOrderEndpoint.cs index 2b66aee..c9d906c 100644 --- a/PyroFetes/Endpoints/PurchaseOrders/GetPurchaseOrderEndpoint.cs +++ b/PyroFetes/Endpoints/PurchaseOrders/GetPurchaseOrderEndpoint.cs @@ -1,7 +1,5 @@ using FastEndpoints; -using Microsoft.EntityFrameworkCore; using PyroFetes.DTO.PurchaseOrder.Response; -using PyroFetes.DTO.PurchaseProduct.Response; using PyroFetes.Models; using PyroFetes.Repositories; using PyroFetes.Specifications.PurchaseOrders; @@ -13,26 +11,24 @@ public class GetPurchaseOrderRequest public int Id { get; set; } } -public class GetPurchaseOrderEndpoint( - PurchaseOrdersRepository purchaseOrdersRepository, - AutoMapper.IMapper mapper) : Endpoint +public class GetPurchaseOrderEndpoint(PurchaseOrdersRepository purchaseOrdersRepository, AutoMapper.IMapper mapper) : Endpoint { public override void Configure() { - Get("/purchaseOrders/{@Id}", x => new {x.Id}); + Get("/purchaseOrders/{@Id}", x => new { x.Id }); AllowAnonymous(); } public override async Task HandleAsync(GetPurchaseOrderRequest req, CancellationToken ct) { - PurchaseOrder? purchaseOrder = await purchaseOrdersRepository.FirstOrDefaultAsync(new GetPurchaseOrderByIdSpec(req.Id), ct); + PurchaseOrder? purchaseOrder = await purchaseOrdersRepository.SingleOrDefaultAsync(new GetPurchaseOrderByIdSpec(req.Id), ct); - if (purchaseOrder == null) + if (purchaseOrder is null) { await Send.NotFoundAsync(ct); return; } - + await Send.OkAsync(mapper.Map(purchaseOrder), ct); } } \ No newline at end of file diff --git a/PyroFetes/Endpoints/PurchaseOrders/GetPurchaseOrderPdfEndpoint.cs b/PyroFetes/Endpoints/PurchaseOrders/GetPurchaseOrderPdfEndpoint.cs index a044b50..05c1f86 100644 --- a/PyroFetes/Endpoints/PurchaseOrders/GetPurchaseOrderPdfEndpoint.cs +++ b/PyroFetes/Endpoints/PurchaseOrders/GetPurchaseOrderPdfEndpoint.cs @@ -5,37 +5,40 @@ using PyroFetes.Models; using PyroFetes.Repositories; using PyroFetes.Services.Pdf; using PyroFetes.Specifications.PurchaseOrders; + namespace PyroFetes.Endpoints.PurchaseOrders; public class GetPurchaseOrderPdfEndpoint( PurchaseOrdersRepository purchaseOrdersRepository, - IPurchaseOrderPdfService purchaseOrderPdfService) + IPurchaseOrderPdfService purchaseOrderPdfService, + SettingsRepository settingsRepository) : Endpoint { public override void Configure() { - Get("/purchaseOrders/{@Id}/pdf", x => new {x.Id}); + Get("/purchaseOrders/{@Id}/pdf", x => new { x.Id }); AllowAnonymous(); Description(b => b.Produces(200, MediaTypeNames.Application.Pdf)); } - + public override async Task HandleAsync(GetPurchaseOrderPdfDto req, CancellationToken ct) { - PurchaseOrder? purchaseOrder = await purchaseOrdersRepository - .FirstOrDefaultAsync(new GetPurchaseOrderByIdWithProductsSpec(req.Id), ct); - - if (purchaseOrder == null) + PurchaseOrder? purchaseOrder = await purchaseOrdersRepository.SingleOrDefaultAsync(new GetPurchaseOrderByIdWithProductsSpec(req.Id), ct); + + if (purchaseOrder is null) { await Send.NotFoundAsync(ct); return; } + + Setting? setting = await settingsRepository.FirstOrDefaultAsync(ct); - var bytes = purchaseOrderPdfService.Generate(purchaseOrder, purchaseOrder.PurchaseProducts!); + byte[] bytes = purchaseOrderPdfService.Generate(purchaseOrder, purchaseOrder.PurchaseProducts!, setting!); await Send.BytesAsync( bytes: bytes, contentType: "application/pdf", - fileName: $"bon-de-commande-{purchaseOrder.Id}.pdf", + fileName: $"bon-de-commande-{purchaseOrder.Id}{DateOnly.FromDateTime(DateTime.Now)}.pdf", cancellation: ct); } } \ No newline at end of file diff --git a/PyroFetes/Endpoints/PurchaseOrders/PatchPurchaseOrderPurchaseConditionsEndpoint.cs b/PyroFetes/Endpoints/PurchaseOrders/PatchPurchaseOrderPurchaseConditionsEndpoint.cs index 7b5c1f5..0adbae4 100644 --- a/PyroFetes/Endpoints/PurchaseOrders/PatchPurchaseOrderPurchaseConditionsEndpoint.cs +++ b/PyroFetes/Endpoints/PurchaseOrders/PatchPurchaseOrderPurchaseConditionsEndpoint.cs @@ -1,17 +1,14 @@ using FastEndpoints; -using Microsoft.EntityFrameworkCore; using PyroFetes.DTO.PurchaseOrder.Request; using PyroFetes.DTO.PurchaseOrder.Response; -using PyroFetes.DTO.PurchaseProduct.Response; using PyroFetes.Models; using PyroFetes.Repositories; using PyroFetes.Specifications.PurchaseOrders; namespace PyroFetes.Endpoints.PurchaseOrders; -public class PatchPurchaseOrderPurchaseConditionsEndpoint( - PurchaseOrdersRepository purchaseOrdersRepository, - AutoMapper.IMapper mapper) : Endpoint +public class PatchPurchaseOrderPurchaseConditionsEndpoint(PurchaseOrdersRepository purchaseOrdersRepository, AutoMapper.IMapper mapper) + : Endpoint { public override void Configure() { @@ -21,16 +18,16 @@ public class PatchPurchaseOrderPurchaseConditionsEndpoint( public override async Task HandleAsync(PatchPurchaseOrderPurchaseConditionsDto req, CancellationToken ct) { - PurchaseOrder? purchaseOrder = await purchaseOrdersRepository.FirstOrDefaultAsync(new GetPurchaseOrderByIdSpec(req.Id), ct); - if (purchaseOrder == null) + PurchaseOrder? purchaseOrder = await purchaseOrdersRepository.SingleOrDefaultAsync(new GetPurchaseOrderByIdSpec(req.Id), ct); + if (purchaseOrder is null) { await Send.NotFoundAsync(ct); return; } - - purchaseOrder.PurchaseConditions = req.PurchaseConditions; - await purchaseOrdersRepository.UpdateAsync(purchaseOrder, ct); - await Send.OkAsync(mapper.Map(purchaseOrder), ct); + mapper.Map(req, purchaseOrder); + + await purchaseOrdersRepository.UpdateAsync(purchaseOrder, ct); + await Send.NoContentAsync(ct); } } \ No newline at end of file diff --git a/PyroFetes/Endpoints/PurchaseOrders/PatchPurchaseProductQuantityEndpoint.cs b/PyroFetes/Endpoints/PurchaseOrders/PatchPurchaseProductQuantityEndpoint.cs new file mode 100644 index 0000000..1453e0a --- /dev/null +++ b/PyroFetes/Endpoints/PurchaseOrders/PatchPurchaseProductQuantityEndpoint.cs @@ -0,0 +1,35 @@ +using FastEndpoints; +using PyroFetes.DTO.PurchaseProduct.Request; +using PyroFetes.DTO.PurchaseProduct.Response; +using PyroFetes.Models; +using PyroFetes.Repositories; +using PyroFetes.Specifications.PurchaseProducts; + +namespace PyroFetes.Endpoints.PurchaseOrders; + +public class PatchPurchaseProductQuantityEndpoint(PurchaseProductsRepository purchaseProductsRepository, AutoMapper.IMapper mapper) + : Endpoint +{ + public override void Configure() + { + Patch("/purchaseOrders/{@ProductId}/{@PurchaseOrderId}/Quantity", x => new { x.ProductId, x.PurchaseOrderId }); + AllowAnonymous(); + } + + public override async Task HandleAsync(PatchPurchaseProductQuantityDto req, CancellationToken ct) + { + PurchaseProduct? purchaseProduct = + await purchaseProductsRepository.SingleOrDefaultAsync(new GetPurchaseProductByProductIdAndPurchaseOrderIdSpec(req.ProductId, req.PurchaseOrderId), ct); + + if (purchaseProduct is null) + { + await Send.NotFoundAsync(ct); + return; + } + + mapper.Map(req, purchaseProduct); + + await purchaseProductsRepository.SaveChangesAsync(ct); + await Send.NoContentAsync(ct); + } +} \ No newline at end of file diff --git a/PyroFetes/Endpoints/PurchaseProducts/CreatePurchaseProductEndpoint.cs b/PyroFetes/Endpoints/PurchaseProducts/CreatePurchaseProductEndpoint.cs deleted file mode 100644 index 24fe1f7..0000000 --- a/PyroFetes/Endpoints/PurchaseProducts/CreatePurchaseProductEndpoint.cs +++ /dev/null @@ -1,56 +0,0 @@ -using FastEndpoints; -using Microsoft.EntityFrameworkCore; -using PyroFetes.DTO.PurchaseProduct.Request; -using PyroFetes.DTO.PurchaseProduct.Response; -using PyroFetes.Models; -using PyroFetes.Repositories; -using PyroFetes.Specifications.Products; -using PyroFetes.Specifications.PurchaseOrders; - -namespace PyroFetes.Endpoints.PurchaseProducts; - -public class CreatePurchaseProductEndpoint( - ProductsRepository productsRepository, - PurchaseOrdersRepository purchaseOrdersRepository, - PurchaseProductsRepository purchaseProductsRepository, - AutoMapper.IMapper mapper) : Endpoint -{ - public override void Configure() - { - Post("/purchaseProducts"); - AllowAnonymous(); - } - - public override async Task HandleAsync(CreatePurchaseProductDto req, CancellationToken ct) - { - Product? product = await productsRepository.FirstOrDefaultAsync(new GetProductByIdSpec(req.ProductId), ct); - if (product == null) - { - await Send.NotFoundAsync(ct); - return; - } - - PurchaseOrder? purchaseOrder = - await purchaseOrdersRepository.FirstOrDefaultAsync(new GetPurchaseOrderByIdSpec(req.PurchaseOrderId), ct); - - if (purchaseOrder == null) - { - purchaseOrder = new PurchaseOrder() - { - PurchaseConditions = req.PurchaseOrderPurchaseConditions ?? "Conditions non précisées" - }; - await purchaseOrdersRepository.AddAsync(purchaseOrder, ct); - } - - PurchaseProduct purchaseProduct = new PurchaseProduct() - { - ProductId = product.Id, - PurchaseOrderId = purchaseOrder.Id, - Quantity = req.Quantity - }; - - await purchaseProductsRepository.AddAsync(purchaseProduct, ct); - - await Send.OkAsync(mapper.Map(purchaseProduct), ct); - } -} \ No newline at end of file diff --git a/PyroFetes/Endpoints/PurchaseProducts/PatchPurchaseProductQuantityEndpoint.cs b/PyroFetes/Endpoints/PurchaseProducts/PatchPurchaseProductQuantityEndpoint.cs deleted file mode 100644 index d1aad89..0000000 --- a/PyroFetes/Endpoints/PurchaseProducts/PatchPurchaseProductQuantityEndpoint.cs +++ /dev/null @@ -1,38 +0,0 @@ -using FastEndpoints; -using Microsoft.EntityFrameworkCore; -using PyroFetes.DTO.PurchaseProduct.Request; -using PyroFetes.DTO.PurchaseProduct.Response; -using PyroFetes.Models; -using PyroFetes.Repositories; -using PyroFetes.Specifications.PurchaseProducts; - -namespace PyroFetes.Endpoints.PurchaseProducts; - -public class PatchPurchaseProductQuantityEndpoint( - PurchaseProductsRepository purchaseProductsRepository, - AutoMapper.IMapper mapper) : Endpoint -{ - public override void Configure() - { - Patch("/purchaseProducts/{@ProductId}/{@PurchaseOrderId}/Quantity", x => new { x.ProductId, x.PurchaseOrderId }); - AllowAnonymous(); - } - - public override async Task HandleAsync(PatchPurchaseProductQuantityDto req, CancellationToken ct) - { - PurchaseProduct? purchaseProduct = - await purchaseProductsRepository.FirstOrDefaultAsync( - new GetPurchaseProductByProductIdAndPurchaseOrderIdSpec(req.ProductId, req.PurchaseOrderId), ct); - - if (purchaseProduct == null) - { - await Send.NotFoundAsync(ct); - return; - } - - purchaseProduct.Quantity = req.Quantity; - await purchaseProductsRepository.UpdateAsync(purchaseProduct, ct); - - await Send.OkAsync(mapper.Map(purchaseProduct), ct); - } -} \ No newline at end of file diff --git a/PyroFetes/Endpoints/QuotationProducts/CreateQuotationProductEndpoint.cs b/PyroFetes/Endpoints/QuotationProducts/CreateQuotationProductEndpoint.cs deleted file mode 100644 index 2c13b2e..0000000 --- a/PyroFetes/Endpoints/QuotationProducts/CreateQuotationProductEndpoint.cs +++ /dev/null @@ -1,58 +0,0 @@ -using FastEndpoints; -using Microsoft.EntityFrameworkCore; -using PyroFetes.DTO.QuotationProduct.Request; -using PyroFetes.DTO.QuotationProduct.Response; -using PyroFetes.Models; -using PyroFetes.Repositories; -using PyroFetes.Specifications.Products; -using PyroFetes.Specifications.Quotations; - -namespace PyroFetes.Endpoints.QuotationProducts; - -public class CreateQuotationProductEndpoint( - QuotationProductsRepository quotationProductsRepository, - ProductsRepository productsRepository, - QuotationsRepository quotationsRepository, - AutoMapper.IMapper mapper) : Endpoint -{ - public override void Configure() - { - Post("/quotationProducts"); - AllowAnonymous(); - } - - public override async Task HandleAsync(CreateQuotationProductDto req, CancellationToken ct) - { - Product? product = await productsRepository.FirstOrDefaultAsync(new GetProductByIdSpec(req.ProductId), ct); - - if (product == null) - { - await Send.NotFoundAsync(ct); - return; - } - - Quotation? quotation = await quotationsRepository.FirstOrDefaultAsync(new GetQuotationByIdSpec(req.QuotationId), ct); - - if (quotation == null) - { - quotation = new Quotation() - { - Message = req.QuotationMessage ?? "", - ConditionsSale = req.QuotationConditionsSale, - }; - - await quotationsRepository.AddAsync(quotation, ct); - } - - QuotationProduct quotationProduct = new QuotationProduct() - { - ProductId = product.Id, - QuotationId = quotation.Id, - Quantity = req.Quantity - }; - - await quotationProductsRepository.AddAsync(quotationProduct, ct); - - await Send.OkAsync(mapper.Map(quotationProduct), ct); - } -} diff --git a/PyroFetes/Endpoints/Quotations/AddProductoToQuotationEndpoint.cs b/PyroFetes/Endpoints/Quotations/AddProductoToQuotationEndpoint.cs new file mode 100644 index 0000000..9d71325 --- /dev/null +++ b/PyroFetes/Endpoints/Quotations/AddProductoToQuotationEndpoint.cs @@ -0,0 +1,35 @@ +using FastEndpoints; +using PyroFetes.DTO.QuotationProduct.Request; +using PyroFetes.DTO.QuotationProduct.Response; +using PyroFetes.Models; +using PyroFetes.Repositories; +using PyroFetes.Specifications.QuotationProducts; + +namespace PyroFetes.Endpoints.Quotations; + +public class AddProductoToQuotationEndpoint( + QuotationProductsRepository quotationProductsRepository, + AutoMapper.IMapper mapper) : Endpoint +{ + public override void Configure() + { + Post("/quotations/{@Id}/products", x => new { x.ProductId, x.QuotationId }); + AllowAnonymous(); + } + + public override async Task HandleAsync(AddQuotationProductDto req, CancellationToken ct) + { + QuotationProduct? productQuotation = await quotationProductsRepository.SingleOrDefaultAsync(new GetQuotationProductByProductIdAndQuotationIdSpec(req.ProductId, req.QuotationId), ct); + + if (productQuotation is not null) + { + await Send.StringAsync("ce produit existe déjà dans le devis", 400, cancellation: ct); + return; + } + + QuotationProduct quotationProduct = mapper.Map(req); + + await quotationProductsRepository.AddAsync(quotationProduct, ct); + await Send.NoContentAsync(ct); + } +} \ No newline at end of file diff --git a/PyroFetes/Endpoints/Quotations/CreateQuotationEndpoint.cs b/PyroFetes/Endpoints/Quotations/CreateQuotationEndpoint.cs index a7003c8..c8ba955 100644 --- a/PyroFetes/Endpoints/Quotations/CreateQuotationEndpoint.cs +++ b/PyroFetes/Endpoints/Quotations/CreateQuotationEndpoint.cs @@ -1,15 +1,19 @@ using FastEndpoints; using PyroFetes.DTO.Quotation.Request; using PyroFetes.DTO.Quotation.Response; +using PyroFetes.DTO.QuotationProduct.Request; using PyroFetes.Models; using PyroFetes.Repositories; +using PyroFetes.Specifications.Products; +using PyroFetes.Specifications.QuotationProducts; namespace PyroFetes.Endpoints.Quotations; public class CreateQuotationEndpoint( QuotationsRepository quotationsRepository, + QuotationProductsRepository quotationProductsRepository, ProductsRepository productsRepository, - AutoMapper.IMapper mapper) : Endpoint + AutoMapper.IMapper mapper) : Endpoint { public override void Configure() { @@ -19,32 +23,36 @@ public class CreateQuotationEndpoint( public override async Task HandleAsync(CreateQuotationDto req, CancellationToken ct) { - Quotation quotation = new Quotation - { - Message = req.Message, - ConditionsSale = req.ConditionsSale ?? "Conditions non précisées", - CustomerId = 1, // A changer - QuotationProducts = new List() - }; + Quotation quotation = mapper.Map(req); + quotation.CustomerId = 1; // TODO: A changer - foreach (var line in req.Products) + if (req.Products != null) { - var product = await productsRepository.GetByIdAsync(line.ProductId, ct); - if (product == null) + foreach (CreateProductQuotationDto line in req.Products) { - await Send.NotFoundAsync(ct); - return; + Product? product = await productsRepository.SingleOrDefaultAsync(new GetProductByIdSpec(line.ProductId), ct); + QuotationProduct? quotationProduct = + await quotationProductsRepository.SingleOrDefaultAsync(new GetQuotationProductByProductIdAndQuotationIdSpec(line.ProductId, quotation.Id), ct); + + if (product is null) + { + await Send.NotFoundAsync(ct); + return; + } + + if (quotationProduct is not null) + { + await Send.StringAsync("Le produit est déjà dans le devis", 400, cancellation: ct); + } + + QuotationProduct? productOnQuotation = mapper.Map(line); + productOnQuotation.QuotationId = quotation.Id; + + await quotationProductsRepository.AddAsync(productOnQuotation, ct); } - - quotation.QuotationProducts.Add(new QuotationProduct - { - ProductId = product.Id, - Quantity = line.Quantity, - }); } await quotationsRepository.AddAsync(quotation, ct); - - await Send.OkAsync(mapper.Map(quotation), ct); + await Send.NoContentAsync(ct); } } \ No newline at end of file diff --git a/PyroFetes/Endpoints/QuotationProducts/DeleteQuotationProductEndpoint.cs b/PyroFetes/Endpoints/Quotations/DeleteProductFromQuotationEndpoint.cs similarity index 55% rename from PyroFetes/Endpoints/QuotationProducts/DeleteQuotationProductEndpoint.cs rename to PyroFetes/Endpoints/Quotations/DeleteProductFromQuotationEndpoint.cs index 554ccd4..569694e 100644 --- a/PyroFetes/Endpoints/QuotationProducts/DeleteQuotationProductEndpoint.cs +++ b/PyroFetes/Endpoints/Quotations/DeleteProductFromQuotationEndpoint.cs @@ -1,10 +1,9 @@ using FastEndpoints; -using Microsoft.EntityFrameworkCore; using PyroFetes.Models; using PyroFetes.Repositories; using PyroFetes.Specifications.QuotationProducts; -namespace PyroFetes.Endpoints.QuotationProducts; +namespace PyroFetes.Endpoints.Quotations; public class DeleteQuotationProductRequest { @@ -12,28 +11,26 @@ public class DeleteQuotationProductRequest public int QuotationId { get; set; } } -public class DeleteQuotationProductEndpoint(QuotationProductsRepository quotationProductsRepository) : Endpoint +public class DeleteProductFromQuotationEndpoint(QuotationProductsRepository quotationProductsRepository) : Endpoint { public override void Configure() { - Delete("/quotationProducts/{@ProductId}/{@QuotationId}", x => new {x.ProductId, x.QuotationId}); + Delete("/quotations/{@ProductId}/{@QuotationId}", x => new { x.ProductId, x.QuotationId }); AllowAnonymous(); } public override async Task HandleAsync(DeleteQuotationProductRequest req, CancellationToken ct) { QuotationProduct? quotationProduct = - await quotationProductsRepository.FirstOrDefaultAsync( - new GetQuotationProductByProductIdAndQuotationIdSpec(req.ProductId, req.QuotationId), ct); + await quotationProductsRepository.SingleOrDefaultAsync(new GetQuotationProductByProductIdAndQuotationIdSpec(req.ProductId, req.QuotationId), ct); - if (quotationProduct == null) + if (quotationProduct is null) { await Send.NotFoundAsync(ct); return; } - + await quotationProductsRepository.DeleteAsync(quotationProduct, ct); - await Send.NoContentAsync(ct); } } \ No newline at end of file diff --git a/PyroFetes/Endpoints/Quotations/DeleteQuotationEndpoint.cs b/PyroFetes/Endpoints/Quotations/DeleteQuotationEndpoint.cs index 80df36c..737fa9e 100644 --- a/PyroFetes/Endpoints/Quotations/DeleteQuotationEndpoint.cs +++ b/PyroFetes/Endpoints/Quotations/DeleteQuotationEndpoint.cs @@ -1,5 +1,4 @@ using FastEndpoints; -using Microsoft.EntityFrameworkCore; using PyroFetes.Models; using PyroFetes.Repositories; using PyroFetes.Specifications.Quotations; @@ -11,33 +10,25 @@ public class DeleteQuotationRequest public int Id { get; set; } } -public class DeleteQuotationEndpoint( - QuotationsRepository quotationsRepository, - QuotationProductsRepository quotationProductsRepository) : Endpoint +public class DeleteQuotationEndpoint(QuotationsRepository quotationsRepository) : Endpoint { public override void Configure() { - Delete("/quotations/{@Id}", x => new {x.Id}); + Delete("/quotations/{@Id}", x => new { x.Id }); AllowAnonymous(); } public override async Task HandleAsync(DeleteQuotationRequest req, CancellationToken ct) { - Quotation? quotation = await quotationsRepository.FirstOrDefaultAsync(new GetQuotationByIdSpec(req.Id), ct); + Quotation? quotation = await quotationsRepository.SingleOrDefaultAsync(new GetQuotationByIdSpec(req.Id), ct); - if (quotation == null) + if (quotation is null) { await Send.NotFoundAsync(ct); return; } - - if (quotation.QuotationProducts != null && quotation.QuotationProducts.Any()) - { - await quotationProductsRepository.DeleteRangeAsync(quotation.QuotationProducts, ct); - } - + await quotationsRepository.DeleteAsync(quotation, ct); - await Send.NoContentAsync(ct); } } \ No newline at end of file diff --git a/PyroFetes/Endpoints/Quotations/GetAllQuotationEndpoint.cs b/PyroFetes/Endpoints/Quotations/GetAllQuotationEndpoint.cs index b4674f3..9d7059d 100644 --- a/PyroFetes/Endpoints/Quotations/GetAllQuotationEndpoint.cs +++ b/PyroFetes/Endpoints/Quotations/GetAllQuotationEndpoint.cs @@ -1,8 +1,5 @@ using FastEndpoints; -using Microsoft.EntityFrameworkCore; using PyroFetes.DTO.Quotation.Response; -using PyroFetes.DTO.QuotationProduct.Response; -using PyroFetes.Models; using PyroFetes.Repositories; namespace PyroFetes.Endpoints.Quotations; diff --git a/PyroFetes/Endpoints/Quotations/GetQuotationEndpoint.cs b/PyroFetes/Endpoints/Quotations/GetQuotationEndpoint.cs index bdc57c2..bc4b4fa 100644 --- a/PyroFetes/Endpoints/Quotations/GetQuotationEndpoint.cs +++ b/PyroFetes/Endpoints/Quotations/GetQuotationEndpoint.cs @@ -1,7 +1,5 @@ using FastEndpoints; -using Microsoft.EntityFrameworkCore; using PyroFetes.DTO.Quotation.Response; -using PyroFetes.DTO.QuotationProduct.Response; using PyroFetes.Models; using PyroFetes.Repositories; using PyroFetes.Specifications.Quotations; @@ -19,20 +17,20 @@ public class GetQuotationEndpoint( { public override void Configure() { - Get("/quotations/{@Id}", x => new {x.Id}); + Get("/quotations/{@Id}", x => new { x.Id }); AllowAnonymous(); } public override async Task HandleAsync(GetQuotationRequest req, CancellationToken ct) { - Quotation? quotation = await quotationsRepository.FirstOrDefaultAsync(new GetQuotationByIdSpec(req.Id), ct); + Quotation? quotation = await quotationsRepository.SingleOrDefaultAsync(new GetQuotationByIdSpec(req.Id), ct); - if (quotation == null) + if (quotation is null) { await Send.NotFoundAsync(ct); return; } - + await Send.OkAsync(mapper.Map(quotation), ct); } } \ No newline at end of file diff --git a/PyroFetes/Endpoints/Quotations/GetQuotationPdfEndpoint.cs b/PyroFetes/Endpoints/Quotations/GetQuotationPdfEndpoint.cs index 2920172..0c75450 100644 --- a/PyroFetes/Endpoints/Quotations/GetQuotationPdfEndpoint.cs +++ b/PyroFetes/Endpoints/Quotations/GetQuotationPdfEndpoint.cs @@ -10,33 +10,35 @@ namespace PyroFetes.Endpoints.Quotations; public class GetQuotationPdfEndpoint( QuotationsRepository quotationRepository, - IQuotationPdfService quotationPdfService) + IQuotationPdfService quotationPdfService, + SettingsRepository settingsRepository) : Endpoint { public override void Configure() { - Get("/quotations/{@Id}/pdf", x => new {x.Id}); + Get("/quotations/{@Id}/pdf", x => new { x.Id }); AllowAnonymous(); Description(b => b.Produces(200, MediaTypeNames.Application.Pdf)); } - + public override async Task HandleAsync(GetQuotationPdfDto req, CancellationToken ct) { - Quotation? quotation = await quotationRepository - .FirstOrDefaultAsync(new GetQuotationByIdWithProductsSpec(req.Id), ct); + Quotation? quotation = await quotationRepository.SingleOrDefaultAsync(new GetQuotationByIdWithProductsSpec(req.Id), ct); - if (quotation == null) + if (quotation is null) { await Send.NotFoundAsync(ct); return; } + + Setting? setting = await settingsRepository.FirstOrDefaultAsync(ct); - var bytes = quotationPdfService.Generate(quotation, quotation.QuotationProducts!); + byte[] bytes = quotationPdfService.Generate(quotation, quotation.QuotationProducts!, setting!); await Send.BytesAsync( bytes: bytes, contentType: "application/pdf", - fileName: $"devis-{quotation.Id}.pdf", + fileName: $"devis-{quotation.Id}{DateOnly.FromDateTime(DateTime.Now)}.pdf", cancellation: ct); } } \ No newline at end of file diff --git a/PyroFetes/Endpoints/Quotations/PatchQuotationConditionsSaleEndpoint.cs b/PyroFetes/Endpoints/Quotations/PatchQuotationConditionsSaleEndpoint.cs index e8287f1..c0a80a8 100644 --- a/PyroFetes/Endpoints/Quotations/PatchQuotationConditionsSaleEndpoint.cs +++ b/PyroFetes/Endpoints/Quotations/PatchQuotationConditionsSaleEndpoint.cs @@ -9,7 +9,7 @@ namespace PyroFetes.Endpoints.Quotations; public class PatchQuotationConditionsSaleEndpoint( QuotationsRepository quotationsRepository, - AutoMapper.IMapper mapper) : Endpoint + AutoMapper.IMapper mapper) : Endpoint { public override void Configure() { @@ -19,18 +19,17 @@ public class PatchQuotationConditionsSaleEndpoint( public override async Task HandleAsync(PatchQuotationConditionsSaleDto req, CancellationToken ct) { - Quotation? quotation = await quotationsRepository.FirstOrDefaultAsync(new GetQuotationByIdSpec(req.Id), ct); - - if (quotation == null) + Quotation? quotation = await quotationsRepository.SingleOrDefaultAsync(new GetQuotationByIdSpec(req.Id), ct); + + if (quotation is null) { await Send.NotFoundAsync(ct); return; } - - quotation.ConditionsSale = req.ConditionsSale; - await quotationsRepository.UpdateAsync(quotation, ct); + mapper.Map(req, quotation); - await Send.OkAsync(mapper.Map(quotation), ct); + await quotationsRepository.SaveChangesAsync(ct); + await Send.NoContentAsync(ct); } } \ No newline at end of file diff --git a/PyroFetes/Endpoints/Quotations/PatchQuotationMessageEndpoint.cs b/PyroFetes/Endpoints/Quotations/PatchQuotationMessageEndpoint.cs new file mode 100644 index 0000000..8de48b4 --- /dev/null +++ b/PyroFetes/Endpoints/Quotations/PatchQuotationMessageEndpoint.cs @@ -0,0 +1,35 @@ +using FastEndpoints; +using PyroFetes.DTO.Quotation.Request; +using PyroFetes.DTO.Quotation.Response; +using PyroFetes.Models; +using PyroFetes.Repositories; +using PyroFetes.Specifications.Quotations; + +namespace PyroFetes.Endpoints.Quotations; + +public class PatchQuotationMessageEndpoint( + QuotationsRepository quotationsRepository, + AutoMapper.IMapper mapper) : Endpoint +{ + public override void Configure() + { + Patch("/quotations/{@Id}/message", x => new { x.Id }); + AllowAnonymous(); + } + + public override async Task HandleAsync(PatchQuotationMessageDto req, CancellationToken ct) + { + Quotation? quotation = await quotationsRepository.SingleOrDefaultAsync(new GetQuotationByIdSpec(req.Id), ct); + + if (quotation is null) + { + await Send.NotFoundAsync(ct); + return; + } + + mapper.Map(req, quotation); + + await quotationsRepository.SaveChangesAsync(ct); + await Send.NoContentAsync(ct); + } +} \ No newline at end of file diff --git a/PyroFetes/Endpoints/QuotationProducts/PatchQuotationProductQuantityEndpoint.cs b/PyroFetes/Endpoints/Quotations/PatchQuotationProductQuantityEndpoint.cs similarity index 52% rename from PyroFetes/Endpoints/QuotationProducts/PatchQuotationProductQuantityEndpoint.cs rename to PyroFetes/Endpoints/Quotations/PatchQuotationProductQuantityEndpoint.cs index de8546e..ad03627 100644 --- a/PyroFetes/Endpoints/QuotationProducts/PatchQuotationProductQuantityEndpoint.cs +++ b/PyroFetes/Endpoints/Quotations/PatchQuotationProductQuantityEndpoint.cs @@ -1,37 +1,35 @@ using FastEndpoints; -using Microsoft.EntityFrameworkCore; using PyroFetes.DTO.QuotationProduct.Request; using PyroFetes.DTO.QuotationProduct.Response; using PyroFetes.Models; using PyroFetes.Repositories; using PyroFetes.Specifications.QuotationProducts; -namespace PyroFetes.Endpoints.QuotationProducts; +namespace PyroFetes.Endpoints.Quotations; public class PatchQuotationProductQuantityEndpoint( QuotationProductsRepository quotationProductsRepository, - AutoMapper.IMapper mapper) : Endpoint + AutoMapper.IMapper mapper) : Endpoint { public override void Configure() { - Patch("/quotationProducts/{@ProductId}/{@QuotationId}/Quantity", x => new { x.ProductId, x.QuotationId }); + Patch("/quotations/{@ProductId}/{@QuotationId}/Quantity", x => new { x.ProductId, x.QuotationId }); AllowAnonymous(); } public override async Task HandleAsync(PatchQuotationProductQuantityDto req, CancellationToken ct) { QuotationProduct? quotationProduct = - await quotationProductsRepository.FirstOrDefaultAsync( - new GetQuotationProductByProductIdAndQuotationIdSpec(req.ProductId, req.QuotationId), ct); - if (quotationProduct == null) + await quotationProductsRepository.SingleOrDefaultAsync(new GetQuotationProductByProductIdAndQuotationIdSpec(req.ProductId, req.QuotationId), ct); + if (quotationProduct is null) { await Send.NotFoundAsync(ct); return; } + + mapper.Map(req, quotationProduct); - quotationProduct.Quantity = req.Quantity; - await quotationProductsRepository.UpdateAsync(quotationProduct, ct); - - await Send.OkAsync(mapper.Map(quotationProduct), ct); + await quotationProductsRepository.SaveChangesAsync(ct); + await Send.NoContentAsync(ct); } } \ No newline at end of file diff --git a/PyroFetes/Endpoints/Quotations/UpdateQuotationEndpoint.cs b/PyroFetes/Endpoints/Quotations/UpdateQuotationEndpoint.cs index 3b1f47b..b383c71 100644 --- a/PyroFetes/Endpoints/Quotations/UpdateQuotationEndpoint.cs +++ b/PyroFetes/Endpoints/Quotations/UpdateQuotationEndpoint.cs @@ -9,7 +9,7 @@ namespace PyroFetes.Endpoints.Quotations; public class UpdateQuotationEndpoint( QuotationsRepository quotationsRepository, - AutoMapper.IMapper mapper) : Endpoint + AutoMapper.IMapper mapper) : Endpoint { public override void Configure() { @@ -19,18 +19,17 @@ public class UpdateQuotationEndpoint( public override async Task HandleAsync(UpdateQuotationDto req, CancellationToken ct) { - Quotation? quotation = await quotationsRepository.FirstOrDefaultAsync(new GetQuotationByIdSpec(req.Id), ct); - - if (quotation == null) + Quotation? quotation = await quotationsRepository.SingleOrDefaultAsync(new GetQuotationByIdSpec(req.Id), ct); + + if (quotation is null) { await Send.NotFoundAsync(ct); return; } + + mapper.Map(req, quotation); - quotation.ConditionsSale = req.ConditionsSale; - quotation.Message = req.Message; - await quotationsRepository.UpdateAsync(quotation, ct); - - await Send.OkAsync(mapper.Map(quotation), ct); + await quotationsRepository.SaveChangesAsync(ct); + await Send.NoContentAsync(ct); } } \ No newline at end of file diff --git a/PyroFetes/Endpoints/Settings/CreateSettingEndpoint.cs b/PyroFetes/Endpoints/Settings/CreateSettingEndpoint.cs index 893996b..a1a12ca 100644 --- a/PyroFetes/Endpoints/Settings/CreateSettingEndpoint.cs +++ b/PyroFetes/Endpoints/Settings/CreateSettingEndpoint.cs @@ -1,14 +1,11 @@ using FastEndpoints; using PyroFetes.DTO.SettingDTO.Request; -using PyroFetes.DTO.SettingDTO.Response; using PyroFetes.Models; using PyroFetes.Repositories; namespace PyroFetes.Endpoints.Settings; -public class CreateSettingEndpoint( - SettingsRepository settingsRepository, - AutoMapper.IMapper mapper) : Endpoint +public class CreateSettingEndpoint(SettingsRepository settingsRepository) : Endpoint { public override void Configure() { @@ -18,14 +15,21 @@ public class CreateSettingEndpoint( public override async Task HandleAsync(CreateSettingDto req, CancellationToken ct) { - Setting setting = new Setting() - { - ElectronicSignature = req.ElectronicSignature, - Logo = req.Logo - }; - - await settingsRepository.AddAsync(setting, ct); + // Encodage en base64 + using MemoryStream memoryStream = new(); + if (req.Logo != null) await req.Logo.CopyToAsync(memoryStream, ct); + byte[] logoBytes = memoryStream.ToArray(); - await Send.OkAsync(mapper.Map(setting), ct); + if (req.ElectronicSignature != null) await req.ElectronicSignature.CopyToAsync(memoryStream, ct); + byte[] signatureBytes = memoryStream.ToArray(); + + Setting setting = new() + { + ElectronicSignature = Convert.ToBase64String(signatureBytes), + Logo = Convert.ToBase64String(logoBytes) + }; + + await settingsRepository.AddAsync(setting, ct); + await Send.NoContentAsync(ct); } } \ No newline at end of file diff --git a/PyroFetes/Endpoints/Settings/DeleteSettingEndpoint.cs b/PyroFetes/Endpoints/Settings/DeleteSettingEndpoint.cs index 2979b01..319acf9 100644 --- a/PyroFetes/Endpoints/Settings/DeleteSettingEndpoint.cs +++ b/PyroFetes/Endpoints/Settings/DeleteSettingEndpoint.cs @@ -1,5 +1,4 @@ using FastEndpoints; -using Microsoft.EntityFrameworkCore; using PyroFetes.Models; using PyroFetes.Repositories; using PyroFetes.Specifications.Settings; @@ -15,22 +14,21 @@ public class DeleteSettingEndpoint(SettingsRepository settingsRepository) : Endp { public override void Configure() { - Delete("/settings/{@Id}", x => new {x.Id}); + Delete("/settings/{@Id}", x => new { x.Id }); AllowAnonymous(); } - + public override async Task HandleAsync(DeleteSettingRequest req, CancellationToken ct) { - Setting? setting = await settingsRepository.FirstOrDefaultAsync(new GetSettingByIdSpec(req.Id), ct); + Setting? setting = await settingsRepository.SingleOrDefaultAsync(new GetSettingByIdSpec(req.Id), ct); - if (setting == null) + if (setting is null) { await Send.NotFoundAsync(ct); return; } - + await settingsRepository.DeleteAsync(setting, ct); - await Send.NoContentAsync(ct); } } \ No newline at end of file diff --git a/PyroFetes/Endpoints/Settings/GetSettingEndpoint.cs b/PyroFetes/Endpoints/Settings/GetSettingEndpoint.cs index 1735008..a36dcd9 100644 --- a/PyroFetes/Endpoints/Settings/GetSettingEndpoint.cs +++ b/PyroFetes/Endpoints/Settings/GetSettingEndpoint.cs @@ -1,5 +1,4 @@ using FastEndpoints; -using Microsoft.EntityFrameworkCore; using PyroFetes.DTO.SettingDTO.Response; using PyroFetes.Models; using PyroFetes.Repositories; @@ -18,15 +17,15 @@ public class GetSettingEndpoint( { public override void Configure() { - Get("/settings/{@Id}", x => new {x.Id}); + Get("/settings/{@Id}", x => new { x.Id }); AllowAnonymous(); } - + public override async Task HandleAsync(GetSettingRequest req, CancellationToken ct) { - Setting? setting = await settingsRepository.FirstOrDefaultAsync(new GetSettingByIdSpec(req.Id), ct); + Setting? setting = await settingsRepository.SingleOrDefaultAsync(new GetSettingByIdSpec(req.Id), ct); - if (setting == null) + if (setting is null) { await Send.NotFoundAsync(ct); return; diff --git a/PyroFetes/Endpoints/Settings/PatchSettingElectronicSignatureEndpoint.cs b/PyroFetes/Endpoints/Settings/PatchSettingElectronicSignatureEndpoint.cs index ca73c8c..2aa7d4e 100644 --- a/PyroFetes/Endpoints/Settings/PatchSettingElectronicSignatureEndpoint.cs +++ b/PyroFetes/Endpoints/Settings/PatchSettingElectronicSignatureEndpoint.cs @@ -1,36 +1,37 @@ using FastEndpoints; -using Microsoft.EntityFrameworkCore; using PyroFetes.DTO.SettingDTO.Request; -using PyroFetes.DTO.SettingDTO.Response; using PyroFetes.Models; using PyroFetes.Repositories; using PyroFetes.Specifications.Settings; namespace PyroFetes.Endpoints.Settings; -public class PatchSettingElectronicSignatureEndpoint( - SettingsRepository settingsRepository, - AutoMapper.IMapper mapper) : Endpoint +public class PatchSettingElectronicSignatureEndpoint(SettingsRepository settingsRepository) : Endpoint { public override void Configure() { - Patch("/settings/{@Id}/ElectronicSignature", x => new {x.Id}); + Patch("/settings/{@Id}/ElectronicSignature", x => new { x.Id }); AllowAnonymous(); } - + public override async Task HandleAsync(PatchSettingElectronicSignatureDto req, CancellationToken ct) { - Setting? setting = await settingsRepository.FirstOrDefaultAsync(new GetSettingByIdSpec(req.Id), ct); - - if (setting == null) + Setting? setting = await settingsRepository.SingleOrDefaultAsync(new GetSettingByIdSpec(req.Id), ct); + + if (setting is null) { await Send.NotFoundAsync(ct); return; } - setting.ElectronicSignature = req.ElectronicSignature; - await settingsRepository.UpdateAsync(setting, ct); - - await Send.OkAsync(mapper.Map(setting), ct); + // Encodage en base64 + using MemoryStream memoryStream = new(); + if (req.ElectronicSignature != null) await req.ElectronicSignature.CopyToAsync(memoryStream, ct); + byte[] signatureBytes = memoryStream.ToArray(); + + setting.ElectronicSignature = Convert.ToBase64String(signatureBytes); + + await settingsRepository.SaveChangesAsync(ct); + await Send.NoContentAsync(ct); } } \ No newline at end of file diff --git a/PyroFetes/Endpoints/Settings/PatchSettingLogoEndpoint.cs b/PyroFetes/Endpoints/Settings/PatchSettingLogoEndpoint.cs index f180cbc..e35bb20 100644 --- a/PyroFetes/Endpoints/Settings/PatchSettingLogoEndpoint.cs +++ b/PyroFetes/Endpoints/Settings/PatchSettingLogoEndpoint.cs @@ -1,36 +1,37 @@ using FastEndpoints; -using Microsoft.EntityFrameworkCore; using PyroFetes.DTO.SettingDTO.Request; -using PyroFetes.DTO.SettingDTO.Response; using PyroFetes.Models; using PyroFetes.Repositories; using PyroFetes.Specifications.Settings; namespace PyroFetes.Endpoints.Settings; -public class PatchSettingLogoEndpoint( - SettingsRepository settingsRepository, - AutoMapper.IMapper mapper) : Endpoint +public class PatchSettingLogoEndpoint(SettingsRepository settingsRepository) : Endpoint { public override void Configure() { - Patch("/settings/{@Id}/logo", x => new {x.Id}); + Patch("/settings/{@Id}/logo", x => new { x.Id }); AllowAnonymous(); } - + public override async Task HandleAsync(PatchSettingLogoDto req, CancellationToken ct) { - Setting? setting = await settingsRepository.FirstOrDefaultAsync(new GetSettingByIdSpec(req.Id), ct); + Setting? setting = await settingsRepository.SingleOrDefaultAsync(new GetSettingByIdSpec(req.Id), ct); - if (setting == null) + if (setting is null) { await Send.NotFoundAsync(ct); return; } - setting.Logo = req.Logo; - await settingsRepository.UpdateAsync(setting, ct); + // Encodage en base64 + using MemoryStream memoryStream = new(); + if (req.Logo != null) await req.Logo.CopyToAsync(memoryStream, ct); + byte[] logoBytes = memoryStream.ToArray(); - await Send.OkAsync(mapper.Map(setting), ct); + setting.Logo = Convert.ToBase64String(logoBytes); + + await settingsRepository.SaveChangesAsync(ct); + await Send.NoContentAsync(ct); } } \ No newline at end of file diff --git a/PyroFetes/Endpoints/Suppliers/AddProductToSupplierEndpoint.cs b/PyroFetes/Endpoints/Suppliers/AddProductToSupplierEndpoint.cs new file mode 100644 index 0000000..6a34252 --- /dev/null +++ b/PyroFetes/Endpoints/Suppliers/AddProductToSupplierEndpoint.cs @@ -0,0 +1,43 @@ +using FastEndpoints; +using PyroFetes.DTO.Price.Request; +using PyroFetes.Models; +using PyroFetes.Repositories; +using PyroFetes.Specifications.Prices; +using PyroFetes.Specifications.Products; +using PyroFetes.Specifications.Suppliers; + +namespace PyroFetes.Endpoints.Suppliers; + +public class AddProductToSupplierEndpoint( + SuppliersRepository suppliersRepository, + ProductsRepository productsRepository, + PricesRepository pricesRepository, + AutoMapper.IMapper mapper) : Endpoint +{ + public override void Configure() + { + Post("/suppliers/{@SupplierId}/{@ProductId}/", x => new { x.SupplierId, x.ProductId }); + AllowAnonymous(); + } + + public override async Task HandleAsync(CreatePriceDto req, CancellationToken ct) + { + Supplier? supplier = await suppliersRepository.FirstOrDefaultAsync(new GetSupplierByIdSpec(req.SupplierId), ct); + Product? product = await productsRepository.SingleOrDefaultAsync(new GetProductByIdSpec(req.ProductId), ct); + if (supplier is null || product is null) + { + await Send.NotFoundAsync(ct); + return; + } + + Price? existingPrice = await pricesRepository.SingleOrDefaultAsync(new GetPriceByProductIdAndSupplierIdSpec(req.ProductId, req.SupplierId), ct); + if (existingPrice is not null) + { + await Send.StringAsync("Le fournisseur a déjà un prix pour ce produit.", 400, cancellation: ct); + return; + } + + await pricesRepository.AddAsync(mapper.Map(req), ct); + await Send.NoContentAsync(ct); + } +} \ No newline at end of file diff --git a/PyroFetes/Endpoints/Suppliers/CreateSupplierEndpoint.cs b/PyroFetes/Endpoints/Suppliers/CreateSupplierEndpoint.cs index afd95f2..6a137e6 100644 --- a/PyroFetes/Endpoints/Suppliers/CreateSupplierEndpoint.cs +++ b/PyroFetes/Endpoints/Suppliers/CreateSupplierEndpoint.cs @@ -1,14 +1,11 @@ using FastEndpoints; using PyroFetes.DTO.Supplier.Request; -using PyroFetes.DTO.Supplier.Response; using PyroFetes.Models; using PyroFetes.Repositories; namespace PyroFetes.Endpoints.Suppliers; -public class CreateSupplierEndpoint( - SuppliersRepository suppliersRepository, - AutoMapper.IMapper mapper) : Endpoint +public class CreateSupplierEndpoint(SuppliersRepository suppliersRepository, AutoMapper.IMapper mapper) : Endpoint { public override void Configure() { @@ -18,19 +15,7 @@ public class CreateSupplierEndpoint( public override async Task HandleAsync(CreateSupplierDto req, CancellationToken ct) { - Supplier? supplier = new Supplier() - { - Name = req.Name, - Email = req.Email, - Phone = req.Phone, - Address = req.Address, - City = req.City, - ZipCode = req.ZipCode, - DeliveryDelay = req.DeliveryDelay - }; - - await suppliersRepository.AddAsync(supplier, ct); - - await Send.OkAsync(mapper.Map(supplier), ct); + await suppliersRepository.AddAsync(mapper.Map(req), ct); + await Send.NoContentAsync(ct); } } \ No newline at end of file diff --git a/PyroFetes/Endpoints/Prices/DeletePriceEndpoint.cs b/PyroFetes/Endpoints/Suppliers/DeleteProductToSupplierEndpoint.cs similarity index 51% rename from PyroFetes/Endpoints/Prices/DeletePriceEndpoint.cs rename to PyroFetes/Endpoints/Suppliers/DeleteProductToSupplierEndpoint.cs index 6ff6577..8c2e514 100644 --- a/PyroFetes/Endpoints/Prices/DeletePriceEndpoint.cs +++ b/PyroFetes/Endpoints/Suppliers/DeleteProductToSupplierEndpoint.cs @@ -1,10 +1,9 @@ using FastEndpoints; -using Microsoft.EntityFrameworkCore; using PyroFetes.Models; using PyroFetes.Repositories; using PyroFetes.Specifications.Prices; -namespace PyroFetes.Endpoints.Prices; +namespace PyroFetes.Endpoints.Suppliers; public class DeletePriceRequest { @@ -12,26 +11,25 @@ public class DeletePriceRequest public int SupplierId { get; set; } } -public class DeletePriceEndpoint(PricesRepository pricesRepository) : Endpoint +public class DeleteProductToSupplierEndpoint(PricesRepository pricesRepository) : Endpoint { public override void Configure() { - Delete("/prices/{@ProductId}/{@SupplierId}", x => new {x.ProductId, x.SupplierId}); + Delete("/suppliers/{@SupplierId}/{@Product}", x => new { x.SupplierId, x.ProductId }); AllowAnonymous(); } public override async Task HandleAsync(DeletePriceRequest req, CancellationToken ct) { - Price? price = await pricesRepository.FirstOrDefaultAsync(new GetPriceByProductIdAndSupplierIdSpec(req.ProductId,req.SupplierId), ct); + Price? price = await pricesRepository.SingleOrDefaultAsync(new GetPriceByProductIdAndSupplierIdSpec(req.ProductId, req.SupplierId), ct); - if (price == null) + if (price is null) { await Send.NotFoundAsync(ct); return; } - - await pricesRepository.DeleteAsync(price, ct); - + + await pricesRepository.DeleteAsync(price, ct); await Send.NoContentAsync(ct); } } \ No newline at end of file diff --git a/PyroFetes/Endpoints/Suppliers/DeleteSupplierEndpoint.cs b/PyroFetes/Endpoints/Suppliers/DeleteSupplierEndpoint.cs index 6786015..40f2655 100644 --- a/PyroFetes/Endpoints/Suppliers/DeleteSupplierEndpoint.cs +++ b/PyroFetes/Endpoints/Suppliers/DeleteSupplierEndpoint.cs @@ -1,5 +1,4 @@ using FastEndpoints; -using Microsoft.EntityFrameworkCore; using PyroFetes.Models; using PyroFetes.Repositories; using PyroFetes.Specifications.Suppliers; @@ -15,22 +14,21 @@ public class DeleteSupplierEndpoint(SuppliersRepository suppliersRepository) : E { public override void Configure() { - Delete("/suppliers/{@Id}", x => new {x.Id}); + Delete("/suppliers/{@Id}", x => new { x.Id }); AllowAnonymous(); } - + public override async Task HandleAsync(DeleteSupplierRequest req, CancellationToken ct) { - Supplier? supplier = await suppliersRepository.FirstOrDefaultAsync(new GetSupplierByIdSpec(req.Id), ct); + Supplier? supplier = await suppliersRepository.SingleOrDefaultAsync(new GetSupplierByIdSpec(req.Id), ct); - if (supplier == null) + if (supplier is null) { await Send.NotFoundAsync(ct); return; } - - await suppliersRepository.DeleteAsync(supplier, ct); - + + await suppliersRepository.DeleteAsync(supplier, ct); await Send.NoContentAsync(ct); } } \ No newline at end of file diff --git a/PyroFetes/Endpoints/Suppliers/GetAllSuppliersEndpoint.cs b/PyroFetes/Endpoints/Suppliers/GetAllSuppliersEndpoint.cs index 3c655f8..5a8bc28 100644 --- a/PyroFetes/Endpoints/Suppliers/GetAllSuppliersEndpoint.cs +++ b/PyroFetes/Endpoints/Suppliers/GetAllSuppliersEndpoint.cs @@ -1,5 +1,4 @@ using FastEndpoints; -using Microsoft.EntityFrameworkCore; using PyroFetes.DTO.Supplier.Response; using PyroFetes.Repositories; diff --git a/PyroFetes/Endpoints/Suppliers/GetSupplierEndpoint.cs b/PyroFetes/Endpoints/Suppliers/GetSupplierEndpoint.cs index 50fbb54..29ba25a 100644 --- a/PyroFetes/Endpoints/Suppliers/GetSupplierEndpoint.cs +++ b/PyroFetes/Endpoints/Suppliers/GetSupplierEndpoint.cs @@ -1,5 +1,4 @@ using FastEndpoints; -using Microsoft.EntityFrameworkCore; using PyroFetes.DTO.Supplier.Response; using PyroFetes.Models; using PyroFetes.Repositories; @@ -12,21 +11,19 @@ public class GetSupplierRequest public int Id { get; set; } } -public class GetSupplierEndpoint( - SuppliersRepository suppliersRepository, - AutoMapper.IMapper mapper) : Endpoint +public class GetSupplierEndpoint(SuppliersRepository suppliersRepository, AutoMapper.IMapper mapper) : Endpoint { public override void Configure() { - Get("/suppliers/{@Id}", x => new {x.Id}); + Get("/suppliers/{@Id}", x => new { x.Id }); AllowAnonymous(); } - + public override async Task HandleAsync(GetSupplierRequest req, CancellationToken ct) { - Supplier? supplier = await suppliersRepository.FirstOrDefaultAsync(new GetSupplierByIdSpec(req.Id), ct); + Supplier? supplier = await suppliersRepository.SingleOrDefaultAsync(new GetSupplierByIdSpec(req.Id), ct); - if (supplier == null) + if (supplier is null) { await Send.NotFoundAsync(ct); return; diff --git a/PyroFetes/Endpoints/Prices/PatchPriceEndpoint.cs b/PyroFetes/Endpoints/Suppliers/PatchPriceEndpoint.cs similarity index 59% rename from PyroFetes/Endpoints/Prices/PatchPriceEndpoint.cs rename to PyroFetes/Endpoints/Suppliers/PatchPriceEndpoint.cs index 23cb247..b6ab7ac 100644 --- a/PyroFetes/Endpoints/Prices/PatchPriceEndpoint.cs +++ b/PyroFetes/Endpoints/Suppliers/PatchPriceEndpoint.cs @@ -1,15 +1,14 @@ using FastEndpoints; using PyroFetes.DTO.Price.Request; -using PyroFetes.DTO.Price.Response; using PyroFetes.Models; using PyroFetes.Repositories; using PyroFetes.Specifications.Prices; -namespace PyroFetes.Endpoints.Prices; +namespace PyroFetes.Endpoints.Suppliers; public class PatchPriceEndpoint( PricesRepository pricesRepository, - AutoMapper.IMapper mapper) : Endpoint + AutoMapper.IMapper mapper) : Endpoint { public override void Configure() { @@ -19,18 +18,17 @@ public class PatchPriceEndpoint( public override async Task HandleAsync(PatchPriceSellingPriceDto req, CancellationToken ct) { - Price? price = await pricesRepository.FirstOrDefaultAsync(new GetPriceByProductIdAndSupplierIdSpec(req.ProductId, req.SupplierId),ct); - - if (price == null) + Price? price = await pricesRepository.SingleOrDefaultAsync(new GetPriceByProductIdAndSupplierIdSpec(req.ProductId, req.SupplierId), ct); + + if (price is null) { await Send.NotFoundAsync(ct); return; } + + mapper.Map(req, price); - price.SellingPrice = req.SellingPrice; - - await pricesRepository.UpdateAsync(price, ct); - - await Send.OkAsync(mapper.Map(price), ct); + await pricesRepository.SaveChangesAsync(ct); + await Send.NoContentAsync(ct); } } \ No newline at end of file diff --git a/PyroFetes/Endpoints/Suppliers/PatchSupplierDeliveryDelayEndpoint.cs b/PyroFetes/Endpoints/Suppliers/PatchSupplierDeliveryDelayEndpoint.cs index 0a83253..b058225 100644 --- a/PyroFetes/Endpoints/Suppliers/PatchSupplierDeliveryDelayEndpoint.cs +++ b/PyroFetes/Endpoints/Suppliers/PatchSupplierDeliveryDelayEndpoint.cs @@ -1,5 +1,4 @@ using FastEndpoints; -using Microsoft.EntityFrameworkCore; using PyroFetes.DTO.Supplier.Request; using PyroFetes.DTO.Supplier.Response; using PyroFetes.Models; @@ -8,29 +7,27 @@ using PyroFetes.Specifications.Suppliers; namespace PyroFetes.Endpoints.Suppliers; -public class PatchSupplierDeliveryDelayEndpoint( - SuppliersRepository suppliersRepository, - AutoMapper.IMapper mapper) : Endpoint +public class PatchSupplierDeliveryDelayEndpoint(SuppliersRepository suppliersRepository, AutoMapper.IMapper mapper) : Endpoint { public override void Configure() { - Patch("/suppliers/{@Id}/deliveryDelay", x => new {x.Id}); + Patch("/suppliers/{@Id}/deliveryDelay", x => new { x.Id }); AllowAnonymous(); } - + public override async Task HandleAsync(PatchSupplierDeliveryDelayDto req, CancellationToken ct) { - Supplier? supplier = await suppliersRepository.FirstOrDefaultAsync(new GetSupplierByIdSpec(req.Id), ct); + Supplier? supplier = await suppliersRepository.SingleOrDefaultAsync(new GetSupplierByIdSpec(req.Id), ct); - if (supplier == null) + if (supplier is null) { await Send.NotFoundAsync(ct); return; } supplier.DeliveryDelay = req.DeliveryDelay; - await suppliersRepository.UpdateAsync(supplier, ct); - + await suppliersRepository.SaveChangesAsync(ct); + await Send.OkAsync(mapper.Map(supplier), ct); } } \ No newline at end of file diff --git a/PyroFetes/Endpoints/Suppliers/UpdateSupplierEndpoint.cs b/PyroFetes/Endpoints/Suppliers/UpdateSupplierEndpoint.cs index 79206ce..d9f79f6 100644 --- a/PyroFetes/Endpoints/Suppliers/UpdateSupplierEndpoint.cs +++ b/PyroFetes/Endpoints/Suppliers/UpdateSupplierEndpoint.cs @@ -1,43 +1,31 @@ using FastEndpoints; -using Microsoft.EntityFrameworkCore; using PyroFetes.DTO.Supplier.Request; -using PyroFetes.DTO.Supplier.Response; using PyroFetes.Models; using PyroFetes.Repositories; using PyroFetes.Specifications.Suppliers; namespace PyroFetes.Endpoints.Suppliers; -public class UpdateSupplierEndpoint( - SuppliersRepository suppliersRepository, - AutoMapper.IMapper mapper) : Endpoint +public class UpdateSupplierEndpoint(SuppliersRepository suppliersRepository, AutoMapper.IMapper mapper) : Endpoint { public override void Configure() { - Put("/suppliers/{@Id}", x => new {x.Id}); + Put("/suppliers/{@Id}", x => new { x.Id }); AllowAnonymous(); } public override async Task HandleAsync(UpdateSupplierDto req, CancellationToken ct) { Supplier? supplier = await suppliersRepository.FirstOrDefaultAsync(new GetSupplierByIdSpec(req.Id), ct); - - if (supplier == null) + if (supplier is null) { await Send.NotFoundAsync(ct); return; } - supplier.Name = req.Name; - supplier.Email = req.Email; - supplier.Phone = req.Phone; - supplier.Address = req.Address; - supplier.City = req.City; - supplier.ZipCode = req.ZipCode; - supplier.DeliveryDelay = req.DeliveryDelay; - - await suppliersRepository.UpdateAsync(supplier, ct); - - await Send.OkAsync(mapper.Map(supplier), ct); + mapper.Map(req, supplier); + + await suppliersRepository.SaveChangesAsync(ct); + await Send.NoContentAsync(ct); } } \ No newline at end of file diff --git a/PyroFetes/Endpoints/Users/ConnectUserEndpoint.cs b/PyroFetes/Endpoints/Users/ConnectUserEndpoint.cs index 07e6eaa..14314c0 100644 --- a/PyroFetes/Endpoints/Users/ConnectUserEndpoint.cs +++ b/PyroFetes/Endpoints/Users/ConnectUserEndpoint.cs @@ -19,31 +19,30 @@ public class ConnectUserEndpoint(UsersRepository usersRepository) : Endpoint - { - o.SigningKey = "ThisIsASuperSecretJwtKeyThatIsAtLeast32CharsLong"; - o.ExpireAt = DateTime.UtcNow.AddMinutes(15); - if (user.Fonction != null) o.User.Roles.Add(user.Fonction); - o.User.Claims.Add(("Name", user.Name)!); - o.User.Claims.Add(("Id", user.Id.ToString())!); - }); + string jwtToken = JwtBearer.CreateToken(o => + { + o.SigningKey = "ThisIsASuperSecretJwtKeyThatIsAtLeast32CharsLong"; + o.ExpireAt = DateTime.UtcNow.AddMinutes(15); + if (user.Fonction is not null) o.User.Roles.Add(user.Fonction); + o.User.Claims.Add(("Name", user.Name)!); + o.User.Claims.Add(("Id", user.Id.ToString())!); + }); GetTokenDto responseDto = new() { Token = jwtToken }; - + await Send.OkAsync(responseDto, ct); } else await Send.UnauthorizedAsync(ct); diff --git a/PyroFetes/Endpoints/Users/CreateUserEndpoint.cs b/PyroFetes/Endpoints/Users/CreateUserEndpoint.cs index 73c557b..a4f183a 100644 --- a/PyroFetes/Endpoints/Users/CreateUserEndpoint.cs +++ b/PyroFetes/Endpoints/Users/CreateUserEndpoint.cs @@ -8,9 +8,7 @@ using PyroFetes.Specifications.Users; namespace PyroFetes.Endpoints.Users; -public class CreateUserEndpoint( - UsersRepository usersRepository, - AutoMapper.IMapper mapper) : Endpoint +public class CreateUserEndpoint(UsersRepository usersRepository) : Endpoint { public override void Configure() { @@ -20,17 +18,17 @@ public class CreateUserEndpoint( public override async Task HandleAsync(CreateUserDto req, CancellationToken ct) { - User? ckeckName = await usersRepository.FirstOrDefaultAsync(new GetUserByNameSpec(req.Name!), ct); - - if (ckeckName != null) + User? ckeckName = await usersRepository.SingleOrDefaultAsync(new GetUserByNameSpec(req.Name!), ct); + + if (ckeckName is not null) { - await Send.StringAsync("Ce nom d'utilisateur existe déjà.",409, cancellation: ct); + await Send.StringAsync("Ce nom d'utilisateur existe déjà.", 400, cancellation: ct); return; } - + string? salt = new Password().IncludeLowercase().IncludeUppercase().IncludeNumeric().LengthRequired(24).Next(); - - User user = new User() + + User user = new() { Name = req.Name, Password = BCrypt.Net.BCrypt.HashPassword(req.Password + salt), @@ -38,9 +36,8 @@ public class CreateUserEndpoint( Email = req.Email, Fonction = req.Fonction }; - + await usersRepository.AddAsync(user, ct); - - await Send.OkAsync(mapper.Map(user), ct); + await Send.NoContentAsync(ct); } } \ No newline at end of file diff --git a/PyroFetes/Endpoints/Users/DeleteUserEndpoint.cs b/PyroFetes/Endpoints/Users/DeleteUserEndpoint.cs index 859d548..32726e4 100644 --- a/PyroFetes/Endpoints/Users/DeleteUserEndpoint.cs +++ b/PyroFetes/Endpoints/Users/DeleteUserEndpoint.cs @@ -1,5 +1,4 @@ using FastEndpoints; -using Microsoft.EntityFrameworkCore; using PyroFetes.Models; using PyroFetes.Repositories; using PyroFetes.Specifications.Users; @@ -15,22 +14,21 @@ public class DeleteUserEndpoint(UsersRepository usersRepository) : Endpoint new {x.Id}); + Delete("/users/{@Id}", x => new { x.Id }); AllowAnonymous(); } public override async Task HandleAsync(DeleteUserRequest req, CancellationToken ct) { - User? user = await usersRepository.FirstOrDefaultAsync(new GetUserByIdSpec(req.Id), ct); + User? user = await usersRepository.SingleOrDefaultAsync(new GetUserByIdSpec(req.Id), ct); - if (user == null) + if (user is null) { await Send.NotFoundAsync(ct); return; } - + await usersRepository.DeleteAsync(user, ct); - await Send.NoContentAsync(ct); } } \ No newline at end of file diff --git a/PyroFetes/Endpoints/Users/GetAllUsersEndpoint.cs b/PyroFetes/Endpoints/Users/GetAllUsersEndpoint.cs index 6a36ca9..46b5003 100644 --- a/PyroFetes/Endpoints/Users/GetAllUsersEndpoint.cs +++ b/PyroFetes/Endpoints/Users/GetAllUsersEndpoint.cs @@ -1,5 +1,4 @@ using FastEndpoints; -using Microsoft.EntityFrameworkCore; using PyroFetes.DTO.User.Response; using PyroFetes.Repositories; diff --git a/PyroFetes/Endpoints/Users/GetUserEndpoint.cs b/PyroFetes/Endpoints/Users/GetUserEndpoint.cs index a03e04f..c6b5d45 100644 --- a/PyroFetes/Endpoints/Users/GetUserEndpoint.cs +++ b/PyroFetes/Endpoints/Users/GetUserEndpoint.cs @@ -1,5 +1,4 @@ using FastEndpoints; -using Microsoft.EntityFrameworkCore; using PyroFetes.DTO.User.Response; using PyroFetes.Models; using PyroFetes.Repositories; @@ -12,26 +11,24 @@ public class GetUserRequest public int Id { get; set; } } -public class GetUserEndpoint( - UsersRepository usersRepository, - AutoMapper.IMapper mapper) : Endpoint +public class GetUserEndpoint(UsersRepository usersRepository, AutoMapper.IMapper mapper) : Endpoint { public override void Configure() { - Get("/users/{@Id}", x => new {x.Id}); + Get("/users/{@Id}", x => new { x.Id }); AllowAnonymous(); } public override async Task HandleAsync(GetUserRequest req, CancellationToken ct) { - User? user = await usersRepository.FirstOrDefaultAsync(new GetUserByIdSpec(req.Id), ct); + User? user = await usersRepository.SingleOrDefaultAsync(new GetUserByIdSpec(req.Id), ct); - if (user == null) + if (user is null) { await Send.NotFoundAsync(ct); return; } - + await Send.OkAsync(mapper.Map(user), ct); } } \ No newline at end of file diff --git a/PyroFetes/Endpoints/Users/PatchUserPasswordEndpoint.cs b/PyroFetes/Endpoints/Users/PatchUserPasswordEndpoint.cs index 1647bd4..d56153d 100644 --- a/PyroFetes/Endpoints/Users/PatchUserPasswordEndpoint.cs +++ b/PyroFetes/Endpoints/Users/PatchUserPasswordEndpoint.cs @@ -1,5 +1,4 @@ using FastEndpoints; -using Microsoft.EntityFrameworkCore; using PyroFetes.DTO.User.Request; using PyroFetes.DTO.User.Response; using PyroFetes.Models; @@ -8,9 +7,7 @@ using PyroFetes.Specifications.Users; namespace PyroFetes.Endpoints.Users; -public class PatchUserPasswordEndpoint( - UsersRepository usersRepository, - AutoMapper.IMapper mapper) : Endpoint +public class PatchUserPasswordEndpoint(UsersRepository usersRepository,AutoMapper.IMapper mapper) : Endpoint { public override void Configure() { @@ -20,9 +17,9 @@ public class PatchUserPasswordEndpoint( public override async Task HandleAsync(PatchUserPasswordDto req, CancellationToken ct) { - User? user = await usersRepository.FirstOrDefaultAsync(new GetUserByIdSpec(req.Id), ct); - - if (user == null) + User? user = await usersRepository.SingleOrDefaultAsync(new GetUserByIdSpec(req.Id), ct); + + if (user is null) { await Send.NotFoundAsync(ct); return; @@ -30,7 +27,7 @@ public class PatchUserPasswordEndpoint( user.Password = BCrypt.Net.BCrypt.HashPassword(req.Password + user.Salt); await usersRepository.UpdateAsync(user, ct); - - await Send.OkAsync(mapper.Map(user), ct); + + await Send.NoContentAsync(ct); } } \ No newline at end of file diff --git a/PyroFetes/Endpoints/Users/UpdateUserEndpoint.cs b/PyroFetes/Endpoints/Users/UpdateUserEndpoint.cs index 46eac23..ead9dbb 100644 --- a/PyroFetes/Endpoints/Users/UpdateUserEndpoint.cs +++ b/PyroFetes/Endpoints/Users/UpdateUserEndpoint.cs @@ -1,5 +1,4 @@ using FastEndpoints; -using Microsoft.EntityFrameworkCore; using PasswordGenerator; using PyroFetes.DTO.User.Request; using PyroFetes.DTO.User.Response; @@ -9,43 +8,41 @@ using PyroFetes.Specifications.Users; namespace PyroFetes.Endpoints.Users; -public class UpdateUserEndpoint( - UsersRepository usersRepository, - AutoMapper.IMapper mapper) : Endpoint +public class UpdateUserEndpoint(UsersRepository usersRepository) : Endpoint { public override void Configure() { - Put("/users/{@Id}", x => new {x.Id}); + Put("/users/{@Id}", x => new { x.Id }); AllowAnonymous(); } public override async Task HandleAsync(UpdateUserDto req, CancellationToken ct) { - User? user = await usersRepository.FirstOrDefaultAsync(new GetUserByIdSpec(req.Id), ct); - User? ckeckName = await usersRepository.FirstOrDefaultAsync(new GetUserByNameSpec(req.Name!), ct); + User? user = await usersRepository.SingleOrDefaultAsync(new GetUserByIdSpec(req.Id), ct); + User? ckeckName = await usersRepository.SingleOrDefaultAsync(new GetUserByNameSpec(req.Name!), ct); - if (user == null) + if (user is null) { await Send.NotFoundAsync(ct); return; } - - if (ckeckName != null && ckeckName.Id != user.Id) + + if (ckeckName is not null && ckeckName.Id != user.Id) { - await Send.StringAsync("Ce nom d'utilisateur existe déjà.",409, cancellation: ct); + await Send.StringAsync("Ce nom d'utilisateur existe déjà.", 400, cancellation: ct); return; } string? salt = new Password().IncludeLowercase().IncludeUppercase().IncludeNumeric().LengthRequired(24).Next(); - + user.Name = req.Name; user.Password = BCrypt.Net.BCrypt.HashPassword(req.Password + salt); user.Salt = salt; user.Email = req.Email; user.Fonction = req.Fonction; - + await usersRepository.UpdateAsync(user, ct); - - await Send.OkAsync(mapper.Map(user), ct); + + await Send.NoContentAsync(ct); } } \ No newline at end of file diff --git a/PyroFetes/Endpoints/WareHouseProducts/GetTotalQuantityEndpoint.cs b/PyroFetes/Endpoints/WareHouseProducts/GetTotalQuantityEndpoint.cs index 0101118..f24ae3e 100644 --- a/PyroFetes/Endpoints/WareHouseProducts/GetTotalQuantityEndpoint.cs +++ b/PyroFetes/Endpoints/WareHouseProducts/GetTotalQuantityEndpoint.cs @@ -1,7 +1,5 @@ using FastEndpoints; -using Microsoft.EntityFrameworkCore; using PyroFetes.DTO.WareHouseProduct.Response; -using PyroFetes.Models; using PyroFetes.Repositories; using PyroFetes.Specifications.WarehouseProducts; @@ -20,21 +18,20 @@ public class GetTotalQuantityEndpoint( Get("/wareHouseProducts/{@ProductId}", x => new { x.ProductId }); AllowAnonymous(); } - + public override async Task HandleAsync(GetTotalQuantityRequest req, CancellationToken ct) { - bool exists = await warehouseProductsRepository.AnyAsync(new GetWarehouseProductByProductIdSpec(req.ProductId), ct); + bool exists = await warehouseProductsRepository.AnyAsync(new GetWarehouseProductByProductIdSpec(req.ProductId, null), ct); if (!exists) { await Send.NotFoundAsync(ct); return; } - - int? totalQuantityNullable = await warehouseProductsRepository. - SumAsync(new GetProductTotalQuantitySpec(req.ProductId), wp => wp.Quantity, ct); - - int totalQuantity = totalQuantityNullable ?? 0; + + int? totalQuantityNullable = await warehouseProductsRepository.SumAsync(new GetProductTotalQuantitySpec(req.ProductId), wp => wp.Quantity, ct); + + int totalQuantity = totalQuantityNullable ?? 0; GetTotalQuantityDto responseDto = new() { diff --git a/PyroFetes/Endpoints/WareHouseProducts/PatchWareHouseProductQuantityEndpoint.cs b/PyroFetes/Endpoints/WareHouseProducts/PatchWareHouseProductQuantityEndpoint.cs index 93a4e07..ff41e56 100644 --- a/PyroFetes/Endpoints/WareHouseProducts/PatchWareHouseProductQuantityEndpoint.cs +++ b/PyroFetes/Endpoints/WareHouseProducts/PatchWareHouseProductQuantityEndpoint.cs @@ -1,13 +1,13 @@ using FastEndpoints; -using Microsoft.EntityFrameworkCore; using PyroFetes.DTO.WareHouseProduct.Request; using PyroFetes.DTO.WareHouseProduct.Response; using PyroFetes.Models; +using PyroFetes.Repositories; +using PyroFetes.Specifications.WarehouseProducts; namespace PyroFetes.Endpoints.WareHouseProducts; -public class PatchWareHouseProductQuantityEndpoint(PyroFetesDbContext database) - : Endpoint +public class PatchWareHouseProductQuantityEndpoint(WarehouseProductsRepository warehouseProductsRepository) : Endpoint { public override void Configure() { @@ -17,25 +17,17 @@ public class PatchWareHouseProductQuantityEndpoint(PyroFetesDbContext database) public override async Task HandleAsync(PatchWareHouseProductQuantityDto req, CancellationToken ct) { - WarehouseProduct? wareHouseProduct = - await database.WarehouseProducts.SingleOrDefaultAsync( - wp => wp.ProductId == req.ProductId && wp.WarehouseId == req.WareHouseId, ct); - - if (wareHouseProduct == null) + WarehouseProduct? wareHouseProduct = await warehouseProductsRepository.FirstOrDefaultAsync(new GetWarehouseProductByProductIdSpec(req.ProductId, req.WareHouseId) , ct); + + if (wareHouseProduct is null) { await Send.NotFoundAsync(ct); return; } wareHouseProduct.Quantity = req.Quantity; - await database.SaveChangesAsync(ct); - - GetWareHouseProductDto responseDto = new() - { - ProductId = wareHouseProduct.ProductId, - WareHouseId = wareHouseProduct.WarehouseId, - Quantity = wareHouseProduct.Quantity - }; - await Send.OkAsync(responseDto, ct); + await warehouseProductsRepository.SaveChangesAsync(ct); + + await Send.NoContentAsync(ct); } } \ No newline at end of file diff --git a/PyroFetes/MappingProfiles/DtoToEntityMappings.cs b/PyroFetes/MappingProfiles/DtoToEntityMappings.cs index 132c135..d79b966 100644 --- a/PyroFetes/MappingProfiles/DtoToEntityMappings.cs +++ b/PyroFetes/MappingProfiles/DtoToEntityMappings.cs @@ -3,7 +3,6 @@ using PyroFetes.DTO.Deliverer.Request; using PyroFetes.DTO.DeliveryNote.Request; using PyroFetes.DTO.Price.Request; using PyroFetes.DTO.Product.Request; -using PyroFetes.DTO.ProductDelivery.Request; using PyroFetes.DTO.PurchaseOrder.Request; using PyroFetes.DTO.PurchaseProduct.Request; using PyroFetes.DTO.Quotation.Request; @@ -21,50 +20,65 @@ public class DtoToEntityMappings : Profile public DtoToEntityMappings() { CreateMap(); - CreateMap(); + CreateMap() + .ForMember(dest => dest.Id, opt => opt.Ignore()); CreateMap(); - CreateMap(); - CreateMap(); + CreateMap() + .ForMember(dest => dest.Id, opt => opt.Ignore()); + CreateMap() + .ForMember(dest => dest.Id, opt => opt.Ignore()); CreateMap(); - CreateMap(); - CreateMap(); + CreateMap() + .ForMember(dest => dest.ProductId, opt => opt.Ignore()) + .ForMember(dest => dest.SupplierId, opt => opt.Ignore()); - CreateMap(); - CreateMap(); - CreateMap(); - - CreateMap(); - CreateMap(); + CreateMap() + .ForMember(dest => dest.Id, opt => opt.Ignore()); + CreateMap() + .ForMember(dest => dest.Id, opt => opt.Ignore()); CreateMap(); - CreateMap(); + CreateMap() + .ForMember(dest => dest.Id, opt => opt.Ignore()); CreateMap(); - CreateMap(); - CreateMap(); + CreateMap() + .ForMember(dest => dest.ProductId, opt => opt.Ignore()) + .ForMember(dest => dest.PurchaseOrderId, opt => opt.Ignore()); - CreateMap(); - CreateMap(); + CreateMap() + .ForMember(dest => dest.Id, opt => opt.Ignore()); + CreateMap() + .ForMember(dest => dest.Id, opt => opt.Ignore()); CreateMap(); - CreateMap(); - CreateMap(); - CreateMap(); + CreateMap(); + CreateMap() + .ForMember(dest => dest.ProductId, opt => opt.Ignore()) + .ForMember(dest => dest.QuotationId, opt => opt.Ignore()); CreateMap(); - CreateMap(); - CreateMap(); + CreateMap() + .ForMember(dest => dest.Id, opt => opt.Ignore()); + CreateMap() + .ForMember(dest => dest.Id, opt => opt.Ignore()); CreateMap(); - CreateMap(); - CreateMap(); + CreateMap() + .ForMember(dest => dest.Id, opt => opt.Ignore()); + CreateMap() + .ForMember(dest => dest.Id, opt => opt.Ignore()); CreateMap(); - CreateMap(); - CreateMap(); + CreateMap() + .ForMember(dest => dest.Id, opt => opt.Ignore()); + CreateMap() + .ForMember(dest => dest.Id, opt => opt.Ignore()); - CreateMap(); + CreateMap() + .ForMember(dest => dest.ProductId, opt => opt.Ignore()) + .ForMember(dest => dest.WarehouseId, opt => opt.Ignore()); } } \ No newline at end of file diff --git a/PyroFetes/MappingProfiles/EntityToDtoMappings.cs b/PyroFetes/MappingProfiles/EntityToDtoMappings.cs index c74e685..5604064 100644 --- a/PyroFetes/MappingProfiles/EntityToDtoMappings.cs +++ b/PyroFetes/MappingProfiles/EntityToDtoMappings.cs @@ -24,46 +24,25 @@ public class EntityToDtoMappings : Profile CreateMap(); - CreateMap(); + CreateMap() + .ForMember(dest => dest.Products, opt => opt.MapFrom(src => src.ProductDeliveries)); CreateMap(); - - CreateMap(); - + + CreateMap() + .ForMember(dest => dest.References, opt => opt.MapFrom(src => src.Reference)); + CreateMap(); - // CreateMap(); - // - //CreateMap(); - - CreateMap() - .ForMember(dest => dest.Products, - opt => opt.MapFrom(src => src.PurchaseProducts)); - - CreateMap() - .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.ProductPrice, opt => opt.MapFrom(src => src.Product.Prices - .FirstOrDefault(p => p.SupplierId == src.PurchaseOrder!.SupplierId) - .SellingPrice)); - - // CreateMap(); - // - //CreateMap(); + .ForMember(dest => dest.Products, opt => opt.MapFrom(src => src.PurchaseProducts)); + CreateMap(); CreateMap() - .ForMember(dest => dest.Products, - opt => opt.MapFrom(src => src.QuotationProducts)); + .ForMember(dest => dest.Products, opt => opt.MapFrom(src => src.QuotationProducts)); - CreateMap() - .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)); + CreateMap(); CreateMap(); diff --git a/PyroFetes/Migrations/20260524095820_ChangeDatabaseName.Designer.cs b/PyroFetes/Migrations/20260524095820_ChangeDatabaseName.Designer.cs new file mode 100644 index 0000000..e644ca2 --- /dev/null +++ b/PyroFetes/Migrations/20260524095820_ChangeDatabaseName.Designer.cs @@ -0,0 +1,1983 @@ +// +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("20260524095820_ChangeDatabaseName")] + partial class ChangeDatabaseName + { + /// + 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.Property("SupplierId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("SupplierId"); + + 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.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") + .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/20260524095820_ChangeDatabaseName.cs b/PyroFetes/Migrations/20260524095820_ChangeDatabaseName.cs new file mode 100644 index 0000000..727fd05 --- /dev/null +++ b/PyroFetes/Migrations/20260524095820_ChangeDatabaseName.cs @@ -0,0 +1,22 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace PyroFetes.Migrations +{ + /// + public partial class ChangeDatabaseName : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + + } + } +} diff --git a/PyroFetes/Program.cs b/PyroFetes/Program.cs index 83ef61b..b056413 100644 --- a/PyroFetes/Program.cs +++ b/PyroFetes/Program.cs @@ -80,7 +80,7 @@ app.UseAuthentication() }) .UseSwaggerGen(); -app.UseHttpsRedirection(); +// app.UseHttpsRedirection(); app.UseCors(); diff --git a/PyroFetes/PyroFetes.csproj b/PyroFetes/PyroFetes.csproj index 5aa90b1..a492cc1 100644 --- a/PyroFetes/PyroFetes.csproj +++ b/PyroFetes/PyroFetes.csproj @@ -31,17 +31,9 @@ <_ContentIncludedByDefault Remove="wwwroot\Images\logo.jpg" /> - - - PreserveNewest - - - PreserveNewest - - - + diff --git a/PyroFetes/PyroFetesDbContext.cs b/PyroFetes/PyroFetesDbContext.cs index f8230eb..7d8c900 100644 --- a/PyroFetes/PyroFetesDbContext.cs +++ b/PyroFetes/PyroFetesDbContext.cs @@ -63,15 +63,13 @@ public class PyroFetesDbContext : DbContext protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) { string connectionString = - "Server=localhost,1433;" + - "Database=pyrofetes-db;" + - "User Id=sa;" + - "Password=AdminMotDePasse!;" + + "Server=romaric-thibault.fr;" + + "Database=PyroFetes-Sujet2;" + + "User Id=pyrofetes;" + + "Password=Crablike8-Fringe-Swimmable;" + "TrustServerCertificate=true;"; optionsBuilder.UseSqlServer(connectionString); - - } // Models customization diff --git a/PyroFetes/Services/Pdf/DeliveryNotePdfService.cs b/PyroFetes/Services/Pdf/DeliveryNotePdfService.cs index e084ec2..eae9b7e 100644 --- a/PyroFetes/Services/Pdf/DeliveryNotePdfService.cs +++ b/PyroFetes/Services/Pdf/DeliveryNotePdfService.cs @@ -7,18 +7,18 @@ namespace PyroFetes.Services.Pdf; public interface IDeliveryNotePdfService { - byte[] Generate(DeliveryNote deliveryNote, List lignes); + byte[] Generate(DeliveryNote deliveryNote, List lignes, Setting setting); } public class DeliveryNotePdfService : IDeliveryNotePdfService { - public byte[] Generate(DeliveryNote deliveryNote, List lignes) + public byte[] Generate(DeliveryNote deliveryNote, List lignes, Setting setting) { - var logoPath = Path.Combine(AppContext.BaseDirectory, "wwwroot", "Images", "logo.jpg"); - var signaturePath = Path.Combine(AppContext.BaseDirectory, "wwwroot", "Images", "signature.png"); + byte[] logo = Convert.FromBase64String(setting.Logo!); + byte[] signature = Convert.FromBase64String(setting.ElectronicSignature!); int total = 0; int totalQuantity = 0; - var document = Document.Create(container => + Document document = Document.Create(container => { container.Page(page => { @@ -48,7 +48,7 @@ public class DeliveryNotePdfService : IDeliveryNotePdfService // Logo + société à droite row.ConstantItem(200).Column(col => { - col.Item().AlignRight().Height(70).Image(logoPath, ImageScaling.FitArea); + col.Item().AlignRight().Height(70).Image(logo, ImageScaling.FitArea); col.Item().Height(20); col.Item().AlignRight().Text("Pyro-Fêtes").SemiBold(); col.Item().Height(5); @@ -93,7 +93,7 @@ public class DeliveryNotePdfService : IDeliveryNotePdfService header.Cell().Element(CellHeader).AlignRight().Text("Total"); }); - foreach (var l in lignes) + foreach (ProductDelivery l in lignes) { table.Cell().Element(CellBody).Text(l.Product?.Name); table.Cell().Element(CellBody).AlignRight().Text(l.Quantity.ToString()); @@ -123,7 +123,7 @@ public class DeliveryNotePdfService : IDeliveryNotePdfService // Signature en bas à droite page.Footer().AlignRight().Column(col => { - col.Item().AlignRight().Height(100).Image(signaturePath, ImageScaling.FitArea); + col.Item().AlignRight().Height(100).Image(signature, ImageScaling.FitArea); }); }); }); diff --git a/PyroFetes/Services/Pdf/PurchaseOrderPdfService.cs b/PyroFetes/Services/Pdf/PurchaseOrderPdfService.cs index 6861e8b..c5ef60e 100644 --- a/PyroFetes/Services/Pdf/PurchaseOrderPdfService.cs +++ b/PyroFetes/Services/Pdf/PurchaseOrderPdfService.cs @@ -7,18 +7,18 @@ namespace PyroFetes.Services.Pdf; public interface IPurchaseOrderPdfService { - byte[] Generate(PurchaseOrder purchaseOrder, List lignes); + byte[] Generate(PurchaseOrder purchaseOrder, List lignes, Setting setting); } public class PurchaseOrderPdfService : IPurchaseOrderPdfService { - public byte[] Generate(PurchaseOrder purchaseOrder, List lignes) + public byte[] Generate(PurchaseOrder purchaseOrder, List lignes, Setting setting) { - var logoPath = Path.Combine(AppContext.BaseDirectory, "wwwroot", "Images", "logo.jpg"); - var signaturePath = Path.Combine(AppContext.BaseDirectory, "wwwroot", "Images", "signature.png"); + byte[] logo = Convert.FromBase64String(setting.Logo!); + byte[] signature = Convert.FromBase64String(setting.ElectronicSignature!); int totalQuantity = 0; decimal total = 0; - var document = Document.Create(container => + Document document = Document.Create(container => { container.Page(page => { @@ -42,7 +42,7 @@ public class PurchaseOrderPdfService : IPurchaseOrderPdfService // Logo + société à droite row.ConstantItem(200).Column(col => { - col.Item().AlignRight().Height(70).Image(logoPath, ImageScaling.FitArea); + col.Item().AlignRight().Height(70).Image(logo, ImageScaling.FitArea); col.Item().Height(20); col.Item().AlignRight().Text("Pyro-Fêtes").SemiBold(); col.Item().Height(5); @@ -90,7 +90,7 @@ public class PurchaseOrderPdfService : IPurchaseOrderPdfService header.Cell().Element(CellHeader).AlignRight().Text("Total"); }); - foreach (var l in lignes) + foreach (PurchaseProduct l in lignes) { decimal price = l.Product!.Prices! .FirstOrDefault(p => p.SupplierId == l.PurchaseOrder!.SupplierId) @@ -140,7 +140,7 @@ public class PurchaseOrderPdfService : IPurchaseOrderPdfService // Signature en bas à droite page.Footer().AlignRight().Column(col => { - col.Item().AlignRight().Height(100).Image(signaturePath, ImageScaling.FitArea); + col.Item().AlignRight().Height(100).Image(signature, ImageScaling.FitArea); }); }); }); diff --git a/PyroFetes/Services/Pdf/QuotationPdfService.cs b/PyroFetes/Services/Pdf/QuotationPdfService.cs index c5709e1..40e4b75 100644 --- a/PyroFetes/Services/Pdf/QuotationPdfService.cs +++ b/PyroFetes/Services/Pdf/QuotationPdfService.cs @@ -1,5 +1,4 @@ using PyroFetes.Models; -using QuestPDF.Companion; using QuestPDF.Fluent; using QuestPDF.Helpers; using QuestPDF.Infrastructure; @@ -8,17 +7,17 @@ namespace PyroFetes.Services.Pdf; public interface IQuotationPdfService { - byte[] Generate(Quotation quotation, List lignes); + byte[] Generate(Quotation quotation, List lignes, Setting setting); } public class QuotationPdfService : IQuotationPdfService { - public byte[] Generate(Quotation quotation, List lignes) + public byte[] Generate(Quotation quotation, List lignes, Setting setting) { - var logoPath = Path.Combine(AppContext.BaseDirectory, "wwwroot", "Images", "logo.jpg"); - var signaturePath = Path.Combine(AppContext.BaseDirectory, "wwwroot", "Images", "signature.png"); + byte[] logo = Convert.FromBase64String(setting.Logo!); + byte[] signature = Convert.FromBase64String(setting.ElectronicSignature!); int total = 0; - var document = Document.Create(container => + Document document = Document.Create(container => { container.Page(page => { @@ -42,7 +41,7 @@ public class QuotationPdfService : IQuotationPdfService // Logo + société à droite row.ConstantItem(200).Column(col => { - col.Item().AlignRight().Height(70).Image(logoPath, ImageScaling.FitArea); + col.Item().AlignRight().Height(70).Image(logo, ImageScaling.FitArea); col.Item().Height(20); col.Item().AlignRight().Text("Pyro-Fêtes").SemiBold(); col.Item().Height(5); @@ -90,7 +89,7 @@ public class QuotationPdfService : IQuotationPdfService header.Cell().Element(CellHeader).AlignRight().Text("Total"); }); - foreach (var l in lignes) + foreach (QuotationProduct l in lignes) { table.Cell().Element(CellBody).Text(l.Product?.Name); table.Cell().Element(CellBody).AlignRight().Text(l.Quantity.ToString()); @@ -134,7 +133,7 @@ public class QuotationPdfService : IQuotationPdfService // Signature en bas à droite page.Footer().AlignRight().Column(col => { - col.Item().AlignRight().Height(100).Image(signaturePath, ImageScaling.FitArea); + col.Item().AlignRight().Height(100).Image(signature, ImageScaling.FitArea); }); }); }); diff --git a/PyroFetes/Specifications/Deliverers/GetDelivererByIdSpec.cs b/PyroFetes/Specifications/Deliverers/GetDelivererByIdSpec.cs index 6376381..8477c0c 100644 --- a/PyroFetes/Specifications/Deliverers/GetDelivererByIdSpec.cs +++ b/PyroFetes/Specifications/Deliverers/GetDelivererByIdSpec.cs @@ -3,7 +3,7 @@ using PyroFetes.Models; namespace PyroFetes.Specifications.Deliverers; -public sealed class GetDelivererByIdSpec : Specification +public sealed class GetDelivererByIdSpec : SingleResultSpecification { public GetDelivererByIdSpec(int delivererId) { diff --git a/PyroFetes/Specifications/DeliveryNotes/GetAllDeliveryNoteSpec.cs b/PyroFetes/Specifications/DeliveryNotes/GetAllDeliveryNoteSpec.cs new file mode 100644 index 0000000..30ef09a --- /dev/null +++ b/PyroFetes/Specifications/DeliveryNotes/GetAllDeliveryNoteSpec.cs @@ -0,0 +1,16 @@ +using Ardalis.Specification; +using PyroFetes.Models; + +namespace PyroFetes.Specifications.DeliveryNotes; + +public class GetAllDeliveryNoteSpec : Specification +{ + public GetAllDeliveryNoteSpec() + { + Query + .Include(x => x.Deliverer) + .Include(x => x.ProductDeliveries)! + .ThenInclude(x => x.Product) + .Where(x => true); + } +} \ No newline at end of file diff --git a/PyroFetes/Specifications/DeliveryNotes/GetDeliveryNoteByIdSpec.cs b/PyroFetes/Specifications/DeliveryNotes/GetDeliveryNoteByIdSpec.cs index 2fc0494..e37a904 100644 --- a/PyroFetes/Specifications/DeliveryNotes/GetDeliveryNoteByIdSpec.cs +++ b/PyroFetes/Specifications/DeliveryNotes/GetDeliveryNoteByIdSpec.cs @@ -3,11 +3,14 @@ using PyroFetes.Models; namespace PyroFetes.Specifications.DeliveryNotes; -public sealed class GetDeliveryNoteByIdSpec : Specification +public sealed class GetDeliveryNoteByIdSpec : SingleResultSpecification { public GetDeliveryNoteByIdSpec(int deliveryNoteId) { Query + .Include(x => x.Deliverer) + .Include(x => x.ProductDeliveries!) + .ThenInclude(x => x.Product) .Where(x => x.Id == deliveryNoteId); } } \ No newline at end of file diff --git a/PyroFetes/Specifications/DeliveryNotes/GetDeliveryNoteByIdWithProductsSpec.cs b/PyroFetes/Specifications/DeliveryNotes/GetDeliveryNoteByIdWithProductsSpec.cs index 5849019..0eb3506 100644 --- a/PyroFetes/Specifications/DeliveryNotes/GetDeliveryNoteByIdWithProductsSpec.cs +++ b/PyroFetes/Specifications/DeliveryNotes/GetDeliveryNoteByIdWithProductsSpec.cs @@ -3,13 +3,13 @@ using PyroFetes.Models; namespace PyroFetes.Specifications.DeliveryNotes; -public class GetDeliveryNoteByIdWithProductsSpec : Specification +public class GetDeliveryNoteByIdWithProductsSpec : SingleResultSpecification { public GetDeliveryNoteByIdWithProductsSpec(int deliveryNoteId) { Query - .Where(d => d.Id == deliveryNoteId) - .Include(d => d.ProductDeliveries!) - .ThenInclude(dp => dp.Product); + .Where(x => x.Id == deliveryNoteId) + .Include(x => x.ProductDeliveries!) + .ThenInclude(p => p.Product); } } \ No newline at end of file diff --git a/PyroFetes/Specifications/Prices/GetPriceByProductIdAndSupplierIdSpec.cs b/PyroFetes/Specifications/Prices/GetPriceByProductIdAndSupplierIdSpec.cs index 5f74c13..42a883b 100644 --- a/PyroFetes/Specifications/Prices/GetPriceByProductIdAndSupplierIdSpec.cs +++ b/PyroFetes/Specifications/Prices/GetPriceByProductIdAndSupplierIdSpec.cs @@ -3,11 +3,11 @@ using PyroFetes.Models; namespace PyroFetes.Specifications.Prices; -public sealed class GetPriceByProductIdAndSupplierIdSpec : Specification +public sealed class GetPriceByProductIdAndSupplierIdSpec : SingleResultSpecification { public GetPriceByProductIdAndSupplierIdSpec(int? productId, int? supplierId) { Query - .Where(p => p.ProductId == productId && p.SupplierId == supplierId); + .Where(x => x.ProductId == productId && x.SupplierId == supplierId); } } \ No newline at end of file diff --git a/PyroFetes/Specifications/Products/GetProductByIdSpec.cs b/PyroFetes/Specifications/Products/GetProductByIdSpec.cs index db1421f..24fb16f 100644 --- a/PyroFetes/Specifications/Products/GetProductByIdSpec.cs +++ b/PyroFetes/Specifications/Products/GetProductByIdSpec.cs @@ -3,9 +3,9 @@ using PyroFetes.Models; namespace PyroFetes.Specifications.Products; -public sealed class GetProductByIdSpec : Specification +public sealed class GetProductByIdSpec : SingleResultSpecification { - public GetProductByIdSpec(int? productId) + public GetProductByIdSpec(int productId) { Query .Where(p => p.Id == productId) diff --git a/PyroFetes/Specifications/Products/GetProductsUnderLimitSpec.cs b/PyroFetes/Specifications/Products/GetProductsUnderLimitSpec.cs index 26c8d12..23075f7 100644 --- a/PyroFetes/Specifications/Products/GetProductsUnderLimitSpec.cs +++ b/PyroFetes/Specifications/Products/GetProductsUnderLimitSpec.cs @@ -9,6 +9,6 @@ public sealed class GetProductsUnderLimitSpec : Specification { Query .Include(p => p.QuotationProducts) - .Where(p => p.QuotationProducts.Any(q => q.Quantity < p.MinimalQuantity)); + .Where(p => p.QuotationProducts != null && p.QuotationProducts.Any(q => q.Quantity < p.MinimalQuantity)); } } \ No newline at end of file diff --git a/PyroFetes/Specifications/PurchaseOrders/GetPurchaseOrderByIdSpec.cs b/PyroFetes/Specifications/PurchaseOrders/GetPurchaseOrderByIdSpec.cs index 272ad75..b903686 100644 --- a/PyroFetes/Specifications/PurchaseOrders/GetPurchaseOrderByIdSpec.cs +++ b/PyroFetes/Specifications/PurchaseOrders/GetPurchaseOrderByIdSpec.cs @@ -3,12 +3,13 @@ using PyroFetes.Models; namespace PyroFetes.Specifications.PurchaseOrders; -public sealed class GetPurchaseOrderByIdSpec : Specification +public sealed class GetPurchaseOrderByIdSpec : SingleResultSpecification { public GetPurchaseOrderByIdSpec(int purchaseOrderId) { Query - .Include(po => po.PurchaseProducts) - .Where(po => po.Id == purchaseOrderId); + .Include(x => x.PurchaseProducts!) + .ThenInclude(x => x.Product) + .Where(x => x.Id == purchaseOrderId); } } \ No newline at end of file diff --git a/PyroFetes/Specifications/PurchaseOrders/GetPurchaseOrderByIdWithProductsSpec.cs b/PyroFetes/Specifications/PurchaseOrders/GetPurchaseOrderByIdWithProductsSpec.cs index 7bac3f8..5b1ae68 100644 --- a/PyroFetes/Specifications/PurchaseOrders/GetPurchaseOrderByIdWithProductsSpec.cs +++ b/PyroFetes/Specifications/PurchaseOrders/GetPurchaseOrderByIdWithProductsSpec.cs @@ -3,14 +3,14 @@ using PyroFetes.Models; namespace PyroFetes.Specifications.PurchaseOrders; -public class GetPurchaseOrderByIdWithProductsSpec : Specification +public class GetPurchaseOrderByIdWithProductsSpec : SingleResultSpecification { public GetPurchaseOrderByIdWithProductsSpec(int purchaseOrderId) { Query - .Where(p => p.Id == purchaseOrderId) - .Include(p => p.PurchaseProducts!) - .ThenInclude(pp => pp.Product) - .ThenInclude(pp=> pp!.Prices); + .Where(x => x.Id == purchaseOrderId) + .Include(x => x.PurchaseProducts!) + .ThenInclude(p => p.Product) + .ThenInclude(p=> p!.Prices); } } \ No newline at end of file diff --git a/PyroFetes/Specifications/PurchaseProducts/GetPurchaseProductByProductIdAndPurchaseOrderIdSpec.cs b/PyroFetes/Specifications/PurchaseProducts/GetPurchaseProductByProductIdAndPurchaseOrderIdSpec.cs index 5d35c62..2d801b6 100644 --- a/PyroFetes/Specifications/PurchaseProducts/GetPurchaseProductByProductIdAndPurchaseOrderIdSpec.cs +++ b/PyroFetes/Specifications/PurchaseProducts/GetPurchaseProductByProductIdAndPurchaseOrderIdSpec.cs @@ -3,7 +3,7 @@ using PyroFetes.Models; namespace PyroFetes.Specifications.PurchaseProducts; -public sealed class GetPurchaseProductByProductIdAndPurchaseOrderIdSpec : Specification +public sealed class GetPurchaseProductByProductIdAndPurchaseOrderIdSpec : SingleResultSpecification { public GetPurchaseProductByProductIdAndPurchaseOrderIdSpec(int productId, int purchaseOrderId) { diff --git a/PyroFetes/Specifications/QuotationProducts/GetQuotationProductByProductIdAndQuotationIdSpec.cs b/PyroFetes/Specifications/QuotationProducts/GetQuotationProductByProductIdAndQuotationIdSpec.cs index 9c3b65a..f0fb536 100644 --- a/PyroFetes/Specifications/QuotationProducts/GetQuotationProductByProductIdAndQuotationIdSpec.cs +++ b/PyroFetes/Specifications/QuotationProducts/GetQuotationProductByProductIdAndQuotationIdSpec.cs @@ -3,7 +3,7 @@ using PyroFetes.Models; namespace PyroFetes.Specifications.QuotationProducts; -public sealed class GetQuotationProductByProductIdAndQuotationIdSpec : Specification +public sealed class GetQuotationProductByProductIdAndQuotationIdSpec : SingleResultSpecification { public GetQuotationProductByProductIdAndQuotationIdSpec(int productId, int quotationId) { diff --git a/PyroFetes/Specifications/Quotations/GetQuotationByIdSpec.cs b/PyroFetes/Specifications/Quotations/GetQuotationByIdSpec.cs index 5f1e183..57cb7b7 100644 --- a/PyroFetes/Specifications/Quotations/GetQuotationByIdSpec.cs +++ b/PyroFetes/Specifications/Quotations/GetQuotationByIdSpec.cs @@ -3,12 +3,13 @@ using PyroFetes.Models; namespace PyroFetes.Specifications.Quotations; -public sealed class GetQuotationByIdSpec : Specification +public sealed class GetQuotationByIdSpec : SingleResultSpecification { public GetQuotationByIdSpec(int quotationId) { Query - .Include(q => q.QuotationProducts) + .Include(x => x.QuotationProducts!) + .ThenInclude(x => x.Product) .Where(x => x.Id == quotationId); } } \ No newline at end of file diff --git a/PyroFetes/Specifications/Quotations/GetQuotationByIdWithProductsSpec.cs b/PyroFetes/Specifications/Quotations/GetQuotationByIdWithProductsSpec.cs index 3e8d724..93d7472 100644 --- a/PyroFetes/Specifications/Quotations/GetQuotationByIdWithProductsSpec.cs +++ b/PyroFetes/Specifications/Quotations/GetQuotationByIdWithProductsSpec.cs @@ -3,13 +3,13 @@ using PyroFetes.Models; namespace PyroFetes.Specifications.Quotations; -public class GetQuotationByIdWithProductsSpec : Specification +public class GetQuotationByIdWithProductsSpec : SingleResultSpecification { public GetQuotationByIdWithProductsSpec(int quotationId) { Query - .Where(q => q.Id == quotationId) - .Include(q => q.QuotationProducts!) - .ThenInclude(qp => qp.Product); + .Where(x => x.Id == quotationId) + .Include(x => x.QuotationProducts!) + .ThenInclude(p => p.Product); } } \ No newline at end of file diff --git a/PyroFetes/Specifications/Settings/GetSettingByIdSpec.cs b/PyroFetes/Specifications/Settings/GetSettingByIdSpec.cs index cc786e4..fb919a8 100644 --- a/PyroFetes/Specifications/Settings/GetSettingByIdSpec.cs +++ b/PyroFetes/Specifications/Settings/GetSettingByIdSpec.cs @@ -3,7 +3,7 @@ using PyroFetes.Models; namespace PyroFetes.Specifications.Settings; -public sealed class GetSettingByIdSpec : Specification +public sealed class GetSettingByIdSpec : SingleResultSpecification { public GetSettingByIdSpec(int settingId) { diff --git a/PyroFetes/Specifications/Suppliers/GetSupplierByIdSpec.cs b/PyroFetes/Specifications/Suppliers/GetSupplierByIdSpec.cs index add1699..c649454 100644 --- a/PyroFetes/Specifications/Suppliers/GetSupplierByIdSpec.cs +++ b/PyroFetes/Specifications/Suppliers/GetSupplierByIdSpec.cs @@ -3,11 +3,13 @@ using PyroFetes.Models; namespace PyroFetes.Specifications.Suppliers; -public sealed class GetSupplierByIdSpec : Specification +public sealed class GetSupplierByIdSpec : SingleResultSpecification { public GetSupplierByIdSpec(int? supplierId) { Query + .Include(x => x.Prices!) + .ThenInclude(p => p.Product) .Where(x => x.Id == supplierId); } } \ No newline at end of file diff --git a/PyroFetes/Specifications/Users/GetUserByIdSpec.cs b/PyroFetes/Specifications/Users/GetUserByIdSpec.cs index db5c0be..7cd8d7c 100644 --- a/PyroFetes/Specifications/Users/GetUserByIdSpec.cs +++ b/PyroFetes/Specifications/Users/GetUserByIdSpec.cs @@ -3,7 +3,7 @@ using PyroFetes.Models; namespace PyroFetes.Specifications.Users; -public sealed class GetUserByIdSpec : Specification +public sealed class GetUserByIdSpec : SingleResultSpecification { public GetUserByIdSpec(int userId) { diff --git a/PyroFetes/Specifications/Users/GetUserByNameSpec.cs b/PyroFetes/Specifications/Users/GetUserByNameSpec.cs index daa75ad..2affac1 100644 --- a/PyroFetes/Specifications/Users/GetUserByNameSpec.cs +++ b/PyroFetes/Specifications/Users/GetUserByNameSpec.cs @@ -3,7 +3,7 @@ using PyroFetes.Models; namespace PyroFetes.Specifications.Users; -public sealed class GetUserByNameSpec : Specification +public sealed class GetUserByNameSpec : SingleResultSpecification { public GetUserByNameSpec(string userName) { diff --git a/PyroFetes/Specifications/WarehouseProducts/GetWarehouseProductByProductIdSpec.cs b/PyroFetes/Specifications/WarehouseProducts/GetWarehouseProductByProductIdSpec.cs index ff135c1..416c01a 100644 --- a/PyroFetes/Specifications/WarehouseProducts/GetWarehouseProductByProductIdSpec.cs +++ b/PyroFetes/Specifications/WarehouseProducts/GetWarehouseProductByProductIdSpec.cs @@ -3,11 +3,16 @@ using PyroFetes.Models; namespace PyroFetes.Specifications.WarehouseProducts; -public sealed class GetWarehouseProductByProductIdSpec : Specification +public sealed class GetWarehouseProductByProductIdSpec : SingleResultSpecification { - public GetWarehouseProductByProductIdSpec(int productId) + public GetWarehouseProductByProductIdSpec(int productId, int? warehouseId = null) { Query .Where(x => x.ProductId == productId); + + if (warehouseId.HasValue) + { + Query.Where(x => x.WarehouseId == warehouseId.Value); + } } } \ No newline at end of file diff --git a/PyroFetes/data.sql b/PyroFetes/data.sql index 6a0d4af..876af84 100644 --- a/PyroFetes/data.sql +++ b/PyroFetes/data.sql @@ -4,336 +4,386 @@ -- 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); +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'); +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'); +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'); +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'); +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); +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); +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, 2), + ('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, 6), + ('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); +INSERT INTO Brands (Name, ProductId) +VALUES ('PyroMaster', 3), + ('GoldFlame', 3), + ('ArtificePlus', 10), + ('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 +INSERT INTO ProductColors (ProductId, ColorId) +VALUES (3, 1), + (3, 3), + (3, 6), -- Bouquet Tricolore : rouge, bleu, blanc + (3, 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 +INSERT INTO ProductEffects (ProductId, EffectId) +VALUES (3, 5), + (3, 8), -- Bouquet : bouquet étoilé, peony + (3, 4), + (4, 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'); +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); +INSERT INTO WarehouseProducts (ProductId, WarehouseId, Quantity) +VALUES (3, 1, 120), + (3, 2, 60), + (3, 3, 80), + (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); +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); +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); +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); +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'); +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); +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); +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); +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); +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'); +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); +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'); +INSERT INTO CustomerTypes (Label) +VALUES ('Mairie / Collectivité'), + ('Association'), + ('Entreprise privée'), + ('Particulier'), + ('Organisateur d événements'); -- ------------------------------------------------------- -- 26. Customers @@ -344,272 +394,372 @@ INSERT INTO CustomerTypes ( Label) VALUES -- ------------------------------------------------------- - -- ------------------------------------------------------- -- 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); +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'); +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); +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'); +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 +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'); +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 +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); +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'); +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'); +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); +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); +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); +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); +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); +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'); +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); +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 +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), +(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), +(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), +(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), +(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), +(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 +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 deleted file mode 100644 index b486e83..0000000 --- a/PyroFetes/docker-compose.yml +++ /dev/null @@ -1,33 +0,0 @@ -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 diff --git a/PyroFetes/wwwroot/Images/logo.jpg b/PyroFetes/wwwroot/Images/logo.jpg deleted file mode 100644 index e459459759d1217e5d65d506dae8249f932963b1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 47397 zcmdqI1yo#5w

_kl+r%HMlzsB)Ge4f@^o94FpJVcXxMaoW=>k-6b><+=2%QA@cZt z_mg{P?wdFBX5O2(Uah^(s#B--u3c68l*+}02fkB_A*4<9!#4?yCTkE^A% zv#lqcm94!aSd!tQ>mvi5qm3kkp^!SSx~r_MgQL_r8833qLYQV+tLYf3v*fX z2@27Ph;j1?3kZsdankYg@`>{Bit_LYaPbL?3-XHd^V9u3Fg%s!Zeu5|Bd759vYy@~ z8U9`=Z*OmIZvk$IyFCw|n3xz3FFy}IKi5+ZE)QR@r=<@U*n{yO669<>tlb@5Jslxn zy1yh^T0y)#B^jPH{kJNBT-DY8DfmBaEfDChdi^c8ho_G1zts3ob9?Cdy4v#S*m^*` z+^ub&vNQgJ`Kj&x+XelV@ktwTIf%6v$QJCWEGNnEl)`P}Xd^DqCoC%}#4pDyCM?6p zCodx{CnP5;DkCo~FCZf(EGYXAUS+U{rzP0h_8+{C|KgSXZ}N)Ey4zZMLfrKr5SM@S zo|Xf|6XM|jaix=${j0Zx=vWOM!8QfC?V z+5bp-vY@}B|1{mFmwy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&`KZ69-{$AOlt!TT(*b^9^nvyI|}r| zi-V7owPK8$04S{gA1+~-&x24?19x-0eSq}?c#7IJH8pjxREda_eUN$ZB$W8jpOqis j{QvTsw*Q+S*!_{Q-FIXoPSo)mz( Date: Sun, 24 May 2026 17:24:44 +0100 Subject: [PATCH 26/51] Cleaned code --- .../DTO/Deliverer/Response/GetDelivererDto.cs | 2 +- .../Request/UpdateDeliveryNoteDto.cs | 2 +- .../Response/GetDeliveryNoteDto.cs | 6 ++--- PyroFetes/DTO/Price/Response/GetPriceDto.cs | 4 +-- .../DTO/Product/Request/UpdateProductDto.cs | 2 +- .../DTO/Product/Response/GetProductDto.cs | 2 +- .../Response/GetProductDeliveryDto.cs | 4 +-- .../Request/CreatePurchaseOrderDto.cs | 2 +- .../Request/CreatePurchaseProductDto.cs | 2 +- .../PatchPurchaseProductQuantityDto.cs | 2 +- .../Response/GetPurchaseProductDto.cs | 4 +-- .../Quotation/Request/GetQuotationPdfDto.cs | 2 +- .../Response/GetQuotationProductDto.cs | 4 +-- .../CreateDeliveryNoteEndpoint.cs | 2 +- .../GetAllDeliveryNoteEndpoint.cs | 2 +- .../GetDeliveryNotePdfEndpoint.cs | 3 ++- .../PatchProductMinimalStockEndpoint.cs | 2 +- .../PurchaseOrders/CreatePurchaseOrder.cs | 4 +-- .../GetPurchaseOrderPdfEndpoint.cs | 6 ++--- .../PatchPurchaseProductQuantityEndpoint.cs | 2 +- .../AddProductoToQuotationEndpoint.cs | 5 ++-- .../Quotations/CreateQuotationEndpoint.cs | 2 +- .../Quotations/GetQuotationPdfEndpoint.cs | 4 +-- .../PatchQuotationConditionsSaleEndpoint.cs | 2 +- .../PatchQuotationMessageEndpoint.cs | 2 +- .../PatchQuotationProductQuantityEndpoint.cs | 2 +- .../Quotations/UpdateQuotationEndpoint.cs | 2 +- .../Settings/CreateSettingEndpoint.cs | 2 +- ...PatchSettingElectronicSignatureEndpoint.cs | 4 +-- .../Settings/PatchSettingLogoEndpoint.cs | 4 +-- .../Suppliers/AddProductToSupplierEndpoint.cs | 4 +-- .../Endpoints/Suppliers/PatchPriceEndpoint.cs | 2 +- .../Users/PatchUserPasswordEndpoint.cs | 2 +- .../PatchWareHouseProductQuantityEndpoint.cs | 4 +-- .../MappingProfiles/DtoToEntityMappings.cs | 14 +++++------ .../MappingProfiles/EntityToDtoMappings.cs | 4 +-- PyroFetes/Models/Availability.cs | 2 +- PyroFetes/Models/Brand.cs | 6 ++--- PyroFetes/Models/City.cs | 6 ++--- PyroFetes/Models/Classification.cs | 6 ++--- PyroFetes/Models/Color.cs | 6 ++--- PyroFetes/Models/Communication.cs | 4 +-- PyroFetes/Models/Contact.cs | 4 +-- PyroFetes/Models/ContactServiceProvider.cs | 2 +- PyroFetes/Models/Customer.cs | 6 ++--- PyroFetes/Models/CustomerType.cs | 4 +-- PyroFetes/Models/Deliverer.cs | 2 +- PyroFetes/Models/DeliveryNote.cs | 2 +- PyroFetes/Models/Effect.cs | 6 ++--- PyroFetes/Models/ExperienceLevel.cs | 2 +- PyroFetes/Models/HistoryOfApproval.cs | 4 +-- PyroFetes/Models/Material.cs | 18 ++++++------- PyroFetes/Models/MaterialWarehouse.cs | 2 +- PyroFetes/Models/Movement.cs | 22 ++++++++-------- PyroFetes/Models/Price.cs | 2 +- PyroFetes/Models/Product.cs | 10 +++----- PyroFetes/Models/ProductCategory.cs | 6 ++--- PyroFetes/Models/ProductColor.cs | 2 +- PyroFetes/Models/ProductDelivery.cs | 2 +- PyroFetes/Models/ProductEffect.cs | 1 - PyroFetes/Models/ProductTimecode.cs | 4 +-- PyroFetes/Models/ProviderType.cs | 4 +-- PyroFetes/Models/PurchaseOrder.cs | 2 +- PyroFetes/Models/Quotation.cs | 4 +-- PyroFetes/Models/QuotationProduct.cs | 4 +-- PyroFetes/Models/ServiceProvider.cs | 6 ++--- PyroFetes/Models/Show.cs | 6 ++--- PyroFetes/Models/ShowMaterial.cs | 1 - PyroFetes/Models/ShowServiceProvider.cs | 3 +-- PyroFetes/Models/Sound.cs | 4 +-- PyroFetes/Models/SoundCategory.cs | 2 +- PyroFetes/Models/SoundTimecode.cs | 2 +- PyroFetes/Models/Staff.cs | 2 +- PyroFetes/Models/Supplier.cs | 4 +-- PyroFetes/Models/Truck.cs | 2 +- PyroFetes/Models/Warehouse.cs | 20 +++++++-------- PyroFetes/Models/WarehouseProduct.cs | 2 +- PyroFetes/Program.cs | 5 +--- PyroFetes/PyroFetesDbContext.cs | 6 ++--- .../Repositories/DeliverersRepository.cs | 2 +- .../QuotationProductsRepository.cs | 2 +- .../Services/Pdf/DeliveryNotePdfService.cs | 21 +++++++--------- .../Services/Pdf/PurchaseOrderPdfService.cs | 25 ++++++++----------- PyroFetes/Services/Pdf/QuotationPdfService.cs | 23 ++++++++--------- .../GetPurchaseOrderByIdWithProductsSpec.cs | 4 +-- ...roductByProductIdAndPurchaseOrderIdSpec.cs | 2 +- .../Specifications/Users/GetUserByNameSpec.cs | 2 +- .../GetProductTotalQuantitySpec.cs | 1 - 88 files changed, 197 insertions(+), 213 deletions(-) diff --git a/PyroFetes/DTO/Deliverer/Response/GetDelivererDto.cs b/PyroFetes/DTO/Deliverer/Response/GetDelivererDto.cs index ee22196..ba638b8 100644 --- a/PyroFetes/DTO/Deliverer/Response/GetDelivererDto.cs +++ b/PyroFetes/DTO/Deliverer/Response/GetDelivererDto.cs @@ -6,6 +6,6 @@ public class GetDelivererDto { public int Id { get; set; } public string? Transporter { get; set; } - + public List? DeliveryNotes { get; set; } } \ No newline at end of file diff --git a/PyroFetes/DTO/DeliveryNote/Request/UpdateDeliveryNoteDto.cs b/PyroFetes/DTO/DeliveryNote/Request/UpdateDeliveryNoteDto.cs index b4746ff..95856e4 100644 --- a/PyroFetes/DTO/DeliveryNote/Request/UpdateDeliveryNoteDto.cs +++ b/PyroFetes/DTO/DeliveryNote/Request/UpdateDeliveryNoteDto.cs @@ -7,6 +7,6 @@ public class UpdateDeliveryNoteDto public DateOnly EstimateDeliveryDate { get; set; } public DateOnly ExpeditionDate { get; set; } public DateOnly? RealDeliveryDate { get; set; } - + public int DelivererId { get; set; } } \ No newline at end of file diff --git a/PyroFetes/DTO/DeliveryNote/Response/GetDeliveryNoteDto.cs b/PyroFetes/DTO/DeliveryNote/Response/GetDeliveryNoteDto.cs index 3683ed3..6365143 100644 --- a/PyroFetes/DTO/DeliveryNote/Response/GetDeliveryNoteDto.cs +++ b/PyroFetes/DTO/DeliveryNote/Response/GetDeliveryNoteDto.cs @@ -9,9 +9,9 @@ public class GetDeliveryNoteDto public DateOnly EstimateDeliveryDate { get; set; } public DateOnly ExpeditionDate { get; set; } public DateOnly? RealDeliveryDate { get; set; } - + public int DelivererId { get; set; } public string? DelivererTransporter { get; set; } - - public List? Products { get; set; } + + public List? Products { get; set; } } \ No newline at end of file diff --git a/PyroFetes/DTO/Price/Response/GetPriceDto.cs b/PyroFetes/DTO/Price/Response/GetPriceDto.cs index 6657f2f..8ad649c 100644 --- a/PyroFetes/DTO/Price/Response/GetPriceDto.cs +++ b/PyroFetes/DTO/Price/Response/GetPriceDto.cs @@ -3,11 +3,11 @@ public class GetPriceDto { public decimal SellingPrice { get; set; } - + public int ProductId { get; set; } public string? ProductReference { get; set; } public string? ProductName { get; set; } - public decimal ProductDuration {get; set;} + public decimal ProductDuration { get; set; } public int ProductCaliber { get; set; } public string? ProductApprovalNumber { get; set; } public decimal ProductWeight { get; set; } diff --git a/PyroFetes/DTO/Product/Request/UpdateProductDto.cs b/PyroFetes/DTO/Product/Request/UpdateProductDto.cs index db70e9c..9a95a03 100644 --- a/PyroFetes/DTO/Product/Request/UpdateProductDto.cs +++ b/PyroFetes/DTO/Product/Request/UpdateProductDto.cs @@ -5,7 +5,7 @@ public class UpdateProductDto public int Id { get; set; } public string? References { get; set; } public string? Name { get; set; } - public decimal Duration {get; set;} + public decimal Duration { get; set; } public int Caliber { get; set; } public string? ApprovalNumber { get; set; } public decimal Weight { get; set; } diff --git a/PyroFetes/DTO/Product/Response/GetProductDto.cs b/PyroFetes/DTO/Product/Response/GetProductDto.cs index c1f85f0..145f245 100644 --- a/PyroFetes/DTO/Product/Response/GetProductDto.cs +++ b/PyroFetes/DTO/Product/Response/GetProductDto.cs @@ -5,7 +5,7 @@ public class GetProductDto public int Id { get; set; } public string? References { get; set; } public string? Name { get; set; } - public decimal Duration {get; set;} + public decimal Duration { get; set; } public int Caliber { get; set; } public string? ApprovalNumber { get; set; } public decimal Weight { get; set; } diff --git a/PyroFetes/DTO/ProductDelivery/Response/GetProductDeliveryDto.cs b/PyroFetes/DTO/ProductDelivery/Response/GetProductDeliveryDto.cs index 92c78cf..58c47ae 100644 --- a/PyroFetes/DTO/ProductDelivery/Response/GetProductDeliveryDto.cs +++ b/PyroFetes/DTO/ProductDelivery/Response/GetProductDeliveryDto.cs @@ -5,7 +5,7 @@ public class GetProductDeliveryDto public int ProductId { get; set; } public string? ProductReference { get; set; } public string? ProductName { get; set; } - public decimal ProductDuration {get; set;} + public decimal ProductDuration { get; set; } public int ProductCaliber { get; set; } public string? ProductApprovalNumber { get; set; } public decimal ProductWeight { get; set; } @@ -13,6 +13,6 @@ public class GetProductDeliveryDto public string? ProductImage { get; set; } public string? ProductLink { get; set; } public int ProductMinimalQuantity { get; set; } - + public int Quantity { get; set; } } \ No newline at end of file diff --git a/PyroFetes/DTO/PurchaseOrder/Request/CreatePurchaseOrderDto.cs b/PyroFetes/DTO/PurchaseOrder/Request/CreatePurchaseOrderDto.cs index e7da0dc..12e3c20 100644 --- a/PyroFetes/DTO/PurchaseOrder/Request/CreatePurchaseOrderDto.cs +++ b/PyroFetes/DTO/PurchaseOrder/Request/CreatePurchaseOrderDto.cs @@ -6,4 +6,4 @@ public class CreatePurchaseOrderDto { public string? PurchaseConditions { get; set; } public List? Products { get; set; } -} +} \ No newline at end of file diff --git a/PyroFetes/DTO/PurchaseProduct/Request/CreatePurchaseProductDto.cs b/PyroFetes/DTO/PurchaseProduct/Request/CreatePurchaseProductDto.cs index f23dfb0..007ab5f 100644 --- a/PyroFetes/DTO/PurchaseProduct/Request/CreatePurchaseProductDto.cs +++ b/PyroFetes/DTO/PurchaseProduct/Request/CreatePurchaseProductDto.cs @@ -2,7 +2,7 @@ namespace PyroFetes.DTO.PurchaseProduct.Request; public class CreatePurchaseProductDto { - public int Quantity { get; set; } + public int Quantity { get; set; } public int ProductId { get; set; } public int PurchaseOrderId { get; set; } } \ No newline at end of file diff --git a/PyroFetes/DTO/PurchaseProduct/Request/PatchPurchaseProductQuantityDto.cs b/PyroFetes/DTO/PurchaseProduct/Request/PatchPurchaseProductQuantityDto.cs index 8bd9499..c19ef2f 100644 --- a/PyroFetes/DTO/PurchaseProduct/Request/PatchPurchaseProductQuantityDto.cs +++ b/PyroFetes/DTO/PurchaseProduct/Request/PatchPurchaseProductQuantityDto.cs @@ -4,5 +4,5 @@ public class PatchPurchaseProductQuantityDto { public int ProductId { get; set; } public int PurchaseOrderId { get; set; } - public int Quantity { get; set; } + public int Quantity { get; set; } } \ No newline at end of file diff --git a/PyroFetes/DTO/PurchaseProduct/Response/GetPurchaseProductDto.cs b/PyroFetes/DTO/PurchaseProduct/Response/GetPurchaseProductDto.cs index e323395..3a61081 100644 --- a/PyroFetes/DTO/PurchaseProduct/Response/GetPurchaseProductDto.cs +++ b/PyroFetes/DTO/PurchaseProduct/Response/GetPurchaseProductDto.cs @@ -5,7 +5,7 @@ public class GetPurchaseProductDto public int ProductId { get; set; } public string? ProductReference { get; set; } public string? ProductName { get; set; } - public decimal ProductDuration {get; set;} + public decimal ProductDuration { get; set; } public int ProductCaliber { get; set; } public string? ProductApprovalNumber { get; set; } public decimal ProductWeight { get; set; } @@ -14,6 +14,6 @@ public class GetPurchaseProductDto public string? ProductLink { get; set; } public int ProductMinimalQuantity { get; set; } public decimal ProductPrice { get; set; } - + public int Quantity { get; set; } } \ No newline at end of file diff --git a/PyroFetes/DTO/Quotation/Request/GetQuotationPdfDto.cs b/PyroFetes/DTO/Quotation/Request/GetQuotationPdfDto.cs index 0c74cd7..fb37fa8 100644 --- a/PyroFetes/DTO/Quotation/Request/GetQuotationPdfDto.cs +++ b/PyroFetes/DTO/Quotation/Request/GetQuotationPdfDto.cs @@ -2,5 +2,5 @@ public class GetQuotationPdfDto { - public int Id { get; set; } + public int Id { get; set; } } \ No newline at end of file diff --git a/PyroFetes/DTO/QuotationProduct/Response/GetQuotationProductDto.cs b/PyroFetes/DTO/QuotationProduct/Response/GetQuotationProductDto.cs index 087e844..06f8ef5 100644 --- a/PyroFetes/DTO/QuotationProduct/Response/GetQuotationProductDto.cs +++ b/PyroFetes/DTO/QuotationProduct/Response/GetQuotationProductDto.cs @@ -3,11 +3,11 @@ namespace PyroFetes.DTO.QuotationProduct.Response; public class GetQuotationProductDto { public int Quantity { get; set; } - + public int ProductId { get; set; } public string? ProductReference { get; set; } public string? ProductName { get; set; } - public decimal ProductDuration {get; set;} + public decimal ProductDuration { get; set; } public int ProductCaliber { get; set; } public string? ProductApprovalNumber { get; set; } public decimal ProductWeight { get; set; } diff --git a/PyroFetes/Endpoints/DeliveryNotes/CreateDeliveryNoteEndpoint.cs b/PyroFetes/Endpoints/DeliveryNotes/CreateDeliveryNoteEndpoint.cs index 3266034..2e62227 100644 --- a/PyroFetes/Endpoints/DeliveryNotes/CreateDeliveryNoteEndpoint.cs +++ b/PyroFetes/Endpoints/DeliveryNotes/CreateDeliveryNoteEndpoint.cs @@ -51,7 +51,7 @@ public class CreateDeliveryNoteEndpoint( DeliveryNote = newDeliveryNote, Quantity = productQuantity.Value, Product = product, - ProductId = product.Id, + ProductId = product.Id, DeliveryNoteId = newDeliveryNote.Id }; diff --git a/PyroFetes/Endpoints/DeliveryNotes/GetAllDeliveryNoteEndpoint.cs b/PyroFetes/Endpoints/DeliveryNotes/GetAllDeliveryNoteEndpoint.cs index 56c19c6..4fbadbe 100644 --- a/PyroFetes/Endpoints/DeliveryNotes/GetAllDeliveryNoteEndpoint.cs +++ b/PyroFetes/Endpoints/DeliveryNotes/GetAllDeliveryNoteEndpoint.cs @@ -15,6 +15,6 @@ public class GetAllDeliveryNoteEndpoint(DeliveryNotesRepository deliveryNotesRep public override async Task HandleAsync(CancellationToken ct) { - await Send.OkAsync(await deliveryNotesRepository.ProjectToListAsync(new GetAllDeliveryNoteSpec() ,ct), ct); + await Send.OkAsync(await deliveryNotesRepository.ProjectToListAsync(new GetAllDeliveryNoteSpec(), ct), ct); } } \ No newline at end of file diff --git a/PyroFetes/Endpoints/DeliveryNotes/GetDeliveryNotePdfEndpoint.cs b/PyroFetes/Endpoints/DeliveryNotes/GetDeliveryNotePdfEndpoint.cs index 19b47d1..aaaaa7f 100644 --- a/PyroFetes/Endpoints/DeliveryNotes/GetDeliveryNotePdfEndpoint.cs +++ b/PyroFetes/Endpoints/DeliveryNotes/GetDeliveryNotePdfEndpoint.cs @@ -8,7 +8,8 @@ using PyroFetes.Specifications.DeliveryNotes; namespace PyroFetes.Endpoints.DeliveryNotes; -public class GetDeliveryNotePdfEndpoint(DeliveryNotesRepository deliveryNotesRepository, IDeliveryNotePdfService deliveryNotePdfService, SettingsRepository settingsRepository) : Endpoint +public class GetDeliveryNotePdfEndpoint(DeliveryNotesRepository deliveryNotesRepository, IDeliveryNotePdfService deliveryNotePdfService, SettingsRepository settingsRepository) + : Endpoint { public override void Configure() { diff --git a/PyroFetes/Endpoints/Products/PatchProductMinimalStockEndpoint.cs b/PyroFetes/Endpoints/Products/PatchProductMinimalStockEndpoint.cs index 40ebeba..dc2229f 100644 --- a/PyroFetes/Endpoints/Products/PatchProductMinimalStockEndpoint.cs +++ b/PyroFetes/Endpoints/Products/PatchProductMinimalStockEndpoint.cs @@ -25,7 +25,7 @@ public class PatchProductMinimalStockEndpoint(ProductsRepository productsReposit } mapper.Map(req, product); - + await productsRepository.UpdateAsync(product, ct); await Send.NoContentAsync(ct); } diff --git a/PyroFetes/Endpoints/PurchaseOrders/CreatePurchaseOrder.cs b/PyroFetes/Endpoints/PurchaseOrders/CreatePurchaseOrder.cs index b30ec5d..0e5406c 100644 --- a/PyroFetes/Endpoints/PurchaseOrders/CreatePurchaseOrder.cs +++ b/PyroFetes/Endpoints/PurchaseOrders/CreatePurchaseOrder.cs @@ -34,8 +34,8 @@ public class CreatePurchaseOrder( await Send.NotFoundAsync(ct); return; } - - PurchaseProduct? purchaseProduct = + + PurchaseProduct? purchaseProduct = await purchaseProductsRepository.SingleOrDefaultAsync(new GetPurchaseProductByProductIdAndPurchaseOrderIdSpec(line.ProductId, purchaseOrder.Id), ct); if (purchaseProduct is not null) diff --git a/PyroFetes/Endpoints/PurchaseOrders/GetPurchaseOrderPdfEndpoint.cs b/PyroFetes/Endpoints/PurchaseOrders/GetPurchaseOrderPdfEndpoint.cs index 05c1f86..2385163 100644 --- a/PyroFetes/Endpoints/PurchaseOrders/GetPurchaseOrderPdfEndpoint.cs +++ b/PyroFetes/Endpoints/PurchaseOrders/GetPurchaseOrderPdfEndpoint.cs @@ -10,7 +10,7 @@ namespace PyroFetes.Endpoints.PurchaseOrders; public class GetPurchaseOrderPdfEndpoint( PurchaseOrdersRepository purchaseOrdersRepository, - IPurchaseOrderPdfService purchaseOrderPdfService, + IPurchaseOrderPdfService purchaseOrderPdfService, SettingsRepository settingsRepository) : Endpoint { @@ -24,7 +24,7 @@ public class GetPurchaseOrderPdfEndpoint( public override async Task HandleAsync(GetPurchaseOrderPdfDto req, CancellationToken ct) { PurchaseOrder? purchaseOrder = await purchaseOrdersRepository.SingleOrDefaultAsync(new GetPurchaseOrderByIdWithProductsSpec(req.Id), ct); - + if (purchaseOrder is null) { await Send.NotFoundAsync(ct); @@ -32,7 +32,7 @@ public class GetPurchaseOrderPdfEndpoint( } Setting? setting = await settingsRepository.FirstOrDefaultAsync(ct); - + byte[] bytes = purchaseOrderPdfService.Generate(purchaseOrder, purchaseOrder.PurchaseProducts!, setting!); await Send.BytesAsync( diff --git a/PyroFetes/Endpoints/PurchaseOrders/PatchPurchaseProductQuantityEndpoint.cs b/PyroFetes/Endpoints/PurchaseOrders/PatchPurchaseProductQuantityEndpoint.cs index 1453e0a..fe32641 100644 --- a/PyroFetes/Endpoints/PurchaseOrders/PatchPurchaseProductQuantityEndpoint.cs +++ b/PyroFetes/Endpoints/PurchaseOrders/PatchPurchaseProductQuantityEndpoint.cs @@ -28,7 +28,7 @@ public class PatchPurchaseProductQuantityEndpoint(PurchaseProductsRepository pur } mapper.Map(req, purchaseProduct); - + await purchaseProductsRepository.SaveChangesAsync(ct); await Send.NoContentAsync(ct); } diff --git a/PyroFetes/Endpoints/Quotations/AddProductoToQuotationEndpoint.cs b/PyroFetes/Endpoints/Quotations/AddProductoToQuotationEndpoint.cs index 9d71325..8a6c9f4 100644 --- a/PyroFetes/Endpoints/Quotations/AddProductoToQuotationEndpoint.cs +++ b/PyroFetes/Endpoints/Quotations/AddProductoToQuotationEndpoint.cs @@ -19,7 +19,8 @@ public class AddProductoToQuotationEndpoint( public override async Task HandleAsync(AddQuotationProductDto req, CancellationToken ct) { - QuotationProduct? productQuotation = await quotationProductsRepository.SingleOrDefaultAsync(new GetQuotationProductByProductIdAndQuotationIdSpec(req.ProductId, req.QuotationId), ct); + QuotationProduct? productQuotation = + await quotationProductsRepository.SingleOrDefaultAsync(new GetQuotationProductByProductIdAndQuotationIdSpec(req.ProductId, req.QuotationId), ct); if (productQuotation is not null) { @@ -28,7 +29,7 @@ public class AddProductoToQuotationEndpoint( } QuotationProduct quotationProduct = mapper.Map(req); - + await quotationProductsRepository.AddAsync(quotationProduct, ct); await Send.NoContentAsync(ct); } diff --git a/PyroFetes/Endpoints/Quotations/CreateQuotationEndpoint.cs b/PyroFetes/Endpoints/Quotations/CreateQuotationEndpoint.cs index c8ba955..1ec4e1f 100644 --- a/PyroFetes/Endpoints/Quotations/CreateQuotationEndpoint.cs +++ b/PyroFetes/Endpoints/Quotations/CreateQuotationEndpoint.cs @@ -33,7 +33,7 @@ public class CreateQuotationEndpoint( Product? product = await productsRepository.SingleOrDefaultAsync(new GetProductByIdSpec(line.ProductId), ct); QuotationProduct? quotationProduct = await quotationProductsRepository.SingleOrDefaultAsync(new GetQuotationProductByProductIdAndQuotationIdSpec(line.ProductId, quotation.Id), ct); - + if (product is null) { await Send.NotFoundAsync(ct); diff --git a/PyroFetes/Endpoints/Quotations/GetQuotationPdfEndpoint.cs b/PyroFetes/Endpoints/Quotations/GetQuotationPdfEndpoint.cs index 0c75450..434ddcf 100644 --- a/PyroFetes/Endpoints/Quotations/GetQuotationPdfEndpoint.cs +++ b/PyroFetes/Endpoints/Quotations/GetQuotationPdfEndpoint.cs @@ -10,7 +10,7 @@ namespace PyroFetes.Endpoints.Quotations; public class GetQuotationPdfEndpoint( QuotationsRepository quotationRepository, - IQuotationPdfService quotationPdfService, + IQuotationPdfService quotationPdfService, SettingsRepository settingsRepository) : Endpoint { @@ -32,7 +32,7 @@ public class GetQuotationPdfEndpoint( } Setting? setting = await settingsRepository.FirstOrDefaultAsync(ct); - + byte[] bytes = quotationPdfService.Generate(quotation, quotation.QuotationProducts!, setting!); await Send.BytesAsync( diff --git a/PyroFetes/Endpoints/Quotations/PatchQuotationConditionsSaleEndpoint.cs b/PyroFetes/Endpoints/Quotations/PatchQuotationConditionsSaleEndpoint.cs index c0a80a8..203913f 100644 --- a/PyroFetes/Endpoints/Quotations/PatchQuotationConditionsSaleEndpoint.cs +++ b/PyroFetes/Endpoints/Quotations/PatchQuotationConditionsSaleEndpoint.cs @@ -28,7 +28,7 @@ public class PatchQuotationConditionsSaleEndpoint( } mapper.Map(req, quotation); - + await quotationsRepository.SaveChangesAsync(ct); await Send.NoContentAsync(ct); } diff --git a/PyroFetes/Endpoints/Quotations/PatchQuotationMessageEndpoint.cs b/PyroFetes/Endpoints/Quotations/PatchQuotationMessageEndpoint.cs index 8de48b4..066f831 100644 --- a/PyroFetes/Endpoints/Quotations/PatchQuotationMessageEndpoint.cs +++ b/PyroFetes/Endpoints/Quotations/PatchQuotationMessageEndpoint.cs @@ -28,7 +28,7 @@ public class PatchQuotationMessageEndpoint( } mapper.Map(req, quotation); - + await quotationsRepository.SaveChangesAsync(ct); await Send.NoContentAsync(ct); } diff --git a/PyroFetes/Endpoints/Quotations/PatchQuotationProductQuantityEndpoint.cs b/PyroFetes/Endpoints/Quotations/PatchQuotationProductQuantityEndpoint.cs index ad03627..f7cc233 100644 --- a/PyroFetes/Endpoints/Quotations/PatchQuotationProductQuantityEndpoint.cs +++ b/PyroFetes/Endpoints/Quotations/PatchQuotationProductQuantityEndpoint.cs @@ -28,7 +28,7 @@ public class PatchQuotationProductQuantityEndpoint( } mapper.Map(req, quotationProduct); - + await quotationProductsRepository.SaveChangesAsync(ct); await Send.NoContentAsync(ct); } diff --git a/PyroFetes/Endpoints/Quotations/UpdateQuotationEndpoint.cs b/PyroFetes/Endpoints/Quotations/UpdateQuotationEndpoint.cs index b383c71..703c69c 100644 --- a/PyroFetes/Endpoints/Quotations/UpdateQuotationEndpoint.cs +++ b/PyroFetes/Endpoints/Quotations/UpdateQuotationEndpoint.cs @@ -28,7 +28,7 @@ public class UpdateQuotationEndpoint( } mapper.Map(req, quotation); - + await quotationsRepository.SaveChangesAsync(ct); await Send.NoContentAsync(ct); } diff --git a/PyroFetes/Endpoints/Settings/CreateSettingEndpoint.cs b/PyroFetes/Endpoints/Settings/CreateSettingEndpoint.cs index a1a12ca..dda0bd1 100644 --- a/PyroFetes/Endpoints/Settings/CreateSettingEndpoint.cs +++ b/PyroFetes/Endpoints/Settings/CreateSettingEndpoint.cs @@ -22,7 +22,7 @@ public class CreateSettingEndpoint(SettingsRepository settingsRepository) : Endp if (req.ElectronicSignature != null) await req.ElectronicSignature.CopyToAsync(memoryStream, ct); byte[] signatureBytes = memoryStream.ToArray(); - + Setting setting = new() { ElectronicSignature = Convert.ToBase64String(signatureBytes), diff --git a/PyroFetes/Endpoints/Settings/PatchSettingElectronicSignatureEndpoint.cs b/PyroFetes/Endpoints/Settings/PatchSettingElectronicSignatureEndpoint.cs index 2aa7d4e..5588935 100644 --- a/PyroFetes/Endpoints/Settings/PatchSettingElectronicSignatureEndpoint.cs +++ b/PyroFetes/Endpoints/Settings/PatchSettingElectronicSignatureEndpoint.cs @@ -28,9 +28,9 @@ public class PatchSettingElectronicSignatureEndpoint(SettingsRepository settings using MemoryStream memoryStream = new(); if (req.ElectronicSignature != null) await req.ElectronicSignature.CopyToAsync(memoryStream, ct); byte[] signatureBytes = memoryStream.ToArray(); - + setting.ElectronicSignature = Convert.ToBase64String(signatureBytes); - + await settingsRepository.SaveChangesAsync(ct); await Send.NoContentAsync(ct); } diff --git a/PyroFetes/Endpoints/Settings/PatchSettingLogoEndpoint.cs b/PyroFetes/Endpoints/Settings/PatchSettingLogoEndpoint.cs index e35bb20..84de016 100644 --- a/PyroFetes/Endpoints/Settings/PatchSettingLogoEndpoint.cs +++ b/PyroFetes/Endpoints/Settings/PatchSettingLogoEndpoint.cs @@ -28,9 +28,9 @@ public class PatchSettingLogoEndpoint(SettingsRepository settingsRepository) : E using MemoryStream memoryStream = new(); if (req.Logo != null) await req.Logo.CopyToAsync(memoryStream, ct); byte[] logoBytes = memoryStream.ToArray(); - + setting.Logo = Convert.ToBase64String(logoBytes); - + await settingsRepository.SaveChangesAsync(ct); await Send.NoContentAsync(ct); } diff --git a/PyroFetes/Endpoints/Suppliers/AddProductToSupplierEndpoint.cs b/PyroFetes/Endpoints/Suppliers/AddProductToSupplierEndpoint.cs index 6a34252..657ee98 100644 --- a/PyroFetes/Endpoints/Suppliers/AddProductToSupplierEndpoint.cs +++ b/PyroFetes/Endpoints/Suppliers/AddProductToSupplierEndpoint.cs @@ -11,7 +11,7 @@ namespace PyroFetes.Endpoints.Suppliers; public class AddProductToSupplierEndpoint( SuppliersRepository suppliersRepository, ProductsRepository productsRepository, - PricesRepository pricesRepository, + PricesRepository pricesRepository, AutoMapper.IMapper mapper) : Endpoint { public override void Configure() @@ -36,7 +36,7 @@ public class AddProductToSupplierEndpoint( await Send.StringAsync("Le fournisseur a déjà un prix pour ce produit.", 400, cancellation: ct); return; } - + await pricesRepository.AddAsync(mapper.Map(req), ct); await Send.NoContentAsync(ct); } diff --git a/PyroFetes/Endpoints/Suppliers/PatchPriceEndpoint.cs b/PyroFetes/Endpoints/Suppliers/PatchPriceEndpoint.cs index b6ab7ac..38002f9 100644 --- a/PyroFetes/Endpoints/Suppliers/PatchPriceEndpoint.cs +++ b/PyroFetes/Endpoints/Suppliers/PatchPriceEndpoint.cs @@ -27,7 +27,7 @@ public class PatchPriceEndpoint( } mapper.Map(req, price); - + await pricesRepository.SaveChangesAsync(ct); await Send.NoContentAsync(ct); } diff --git a/PyroFetes/Endpoints/Users/PatchUserPasswordEndpoint.cs b/PyroFetes/Endpoints/Users/PatchUserPasswordEndpoint.cs index d56153d..760ce32 100644 --- a/PyroFetes/Endpoints/Users/PatchUserPasswordEndpoint.cs +++ b/PyroFetes/Endpoints/Users/PatchUserPasswordEndpoint.cs @@ -7,7 +7,7 @@ using PyroFetes.Specifications.Users; namespace PyroFetes.Endpoints.Users; -public class PatchUserPasswordEndpoint(UsersRepository usersRepository,AutoMapper.IMapper mapper) : Endpoint +public class PatchUserPasswordEndpoint(UsersRepository usersRepository, AutoMapper.IMapper mapper) : Endpoint { public override void Configure() { diff --git a/PyroFetes/Endpoints/WareHouseProducts/PatchWareHouseProductQuantityEndpoint.cs b/PyroFetes/Endpoints/WareHouseProducts/PatchWareHouseProductQuantityEndpoint.cs index ff41e56..e346e9b 100644 --- a/PyroFetes/Endpoints/WareHouseProducts/PatchWareHouseProductQuantityEndpoint.cs +++ b/PyroFetes/Endpoints/WareHouseProducts/PatchWareHouseProductQuantityEndpoint.cs @@ -17,7 +17,7 @@ public class PatchWareHouseProductQuantityEndpoint(WarehouseProductsRepository w public override async Task HandleAsync(PatchWareHouseProductQuantityDto req, CancellationToken ct) { - WarehouseProduct? wareHouseProduct = await warehouseProductsRepository.FirstOrDefaultAsync(new GetWarehouseProductByProductIdSpec(req.ProductId, req.WareHouseId) , ct); + WarehouseProduct? wareHouseProduct = await warehouseProductsRepository.FirstOrDefaultAsync(new GetWarehouseProductByProductIdSpec(req.ProductId, req.WareHouseId), ct); if (wareHouseProduct is null) { @@ -27,7 +27,7 @@ public class PatchWareHouseProductQuantityEndpoint(WarehouseProductsRepository w wareHouseProduct.Quantity = req.Quantity; await warehouseProductsRepository.SaveChangesAsync(ct); - + await Send.NoContentAsync(ct); } } \ No newline at end of file diff --git a/PyroFetes/MappingProfiles/DtoToEntityMappings.cs b/PyroFetes/MappingProfiles/DtoToEntityMappings.cs index d79b966..152d0c3 100644 --- a/PyroFetes/MappingProfiles/DtoToEntityMappings.cs +++ b/PyroFetes/MappingProfiles/DtoToEntityMappings.cs @@ -38,16 +38,16 @@ public class DtoToEntityMappings : Profile .ForMember(dest => dest.Id, opt => opt.Ignore()); CreateMap() .ForMember(dest => dest.Id, opt => opt.Ignore()); - + CreateMap(); - CreateMap() + CreateMap() .ForMember(dest => dest.Id, opt => opt.Ignore()); - + CreateMap(); CreateMap() .ForMember(dest => dest.ProductId, opt => opt.Ignore()) .ForMember(dest => dest.PurchaseOrderId, opt => opt.Ignore()); - + CreateMap() .ForMember(dest => dest.Id, opt => opt.Ignore()); CreateMap() @@ -58,19 +58,19 @@ public class DtoToEntityMappings : Profile CreateMap() .ForMember(dest => dest.ProductId, opt => opt.Ignore()) .ForMember(dest => dest.QuotationId, opt => opt.Ignore()); - + CreateMap(); CreateMap() .ForMember(dest => dest.Id, opt => opt.Ignore()); CreateMap() .ForMember(dest => dest.Id, opt => opt.Ignore()); - + CreateMap(); CreateMap() .ForMember(dest => dest.Id, opt => opt.Ignore()); CreateMap() .ForMember(dest => dest.Id, opt => opt.Ignore()); - + CreateMap(); CreateMap() .ForMember(dest => dest.Id, opt => opt.Ignore()); diff --git a/PyroFetes/MappingProfiles/EntityToDtoMappings.cs b/PyroFetes/MappingProfiles/EntityToDtoMappings.cs index 5604064..b312e96 100644 --- a/PyroFetes/MappingProfiles/EntityToDtoMappings.cs +++ b/PyroFetes/MappingProfiles/EntityToDtoMappings.cs @@ -28,10 +28,10 @@ public class EntityToDtoMappings : Profile .ForMember(dest => dest.Products, opt => opt.MapFrom(src => src.ProductDeliveries)); CreateMap(); - + CreateMap() .ForMember(dest => dest.References, opt => opt.MapFrom(src => src.Reference)); - + CreateMap(); CreateMap() diff --git a/PyroFetes/Models/Availability.cs b/PyroFetes/Models/Availability.cs index 47b0f1c..9fb6043 100644 --- a/PyroFetes/Models/Availability.cs +++ b/PyroFetes/Models/Availability.cs @@ -9,6 +9,6 @@ public class Availability [Required] public DateOnly DeliveryDate { get; set; } [Required] public DateOnly ExpirationDate { get; set; } [Required] public DateOnly RenewallDate { get; set; } - + public List? StaffAvailabilities { get; set; } } \ No newline at end of file diff --git a/PyroFetes/Models/Brand.cs b/PyroFetes/Models/Brand.cs index 49016ca..8d4050c 100644 --- a/PyroFetes/Models/Brand.cs +++ b/PyroFetes/Models/Brand.cs @@ -4,9 +4,9 @@ namespace PyroFetes.Models; public class Brand { - [Key] public int Id { get; set; } - [Required, MaxLength(100)] public string? Name { get; set; } - + [Key] public int Id { get; set; } + [Required, MaxLength(100)] public string? Name { get; set; } + [Required] public int ProductId { get; set; } [Required] public Product? Product { get; set; } } \ No newline at end of file diff --git a/PyroFetes/Models/City.cs b/PyroFetes/Models/City.cs index 04dc24e..caeb683 100644 --- a/PyroFetes/Models/City.cs +++ b/PyroFetes/Models/City.cs @@ -4,9 +4,9 @@ namespace PyroFetes.Models; public class City { - [Key] public int Id { get; set; } - [Required, MaxLength(100)] public string? Name { get; set; } + [Key] public int Id { get; set; } + [Required, MaxLength(100)] public string? Name { get; set; } [Required] public int ZipCode { get; set; } - + public List? Shows { get; set; } } \ No newline at end of file diff --git a/PyroFetes/Models/Classification.cs b/PyroFetes/Models/Classification.cs index bd3685b..c58c344 100644 --- a/PyroFetes/Models/Classification.cs +++ b/PyroFetes/Models/Classification.cs @@ -4,8 +4,8 @@ namespace PyroFetes.Models; public class Classification { - [Key] public int Id { get; set; } - [Required, MaxLength(100)] public string? Label { get; set; } - + [Key] public int Id { get; set; } + [Required, MaxLength(100)] public string? Label { get; set; } + public List? Products { get; set; } } \ No newline at end of file diff --git a/PyroFetes/Models/Color.cs b/PyroFetes/Models/Color.cs index acfe830..6ab01d7 100644 --- a/PyroFetes/Models/Color.cs +++ b/PyroFetes/Models/Color.cs @@ -4,8 +4,8 @@ namespace PyroFetes.Models; public class Color { - [Key] public int Id { get; set; } - [Required, MaxLength(100)] public string? Label { get; set; } - + [Key] public int Id { get; set; } + [Required, MaxLength(100)] public string? Label { get; set; } + public List? ProductColors { get; set; } } \ No newline at end of file diff --git a/PyroFetes/Models/Communication.cs b/PyroFetes/Models/Communication.cs index a3dd0d2..1483100 100644 --- a/PyroFetes/Models/Communication.cs +++ b/PyroFetes/Models/Communication.cs @@ -4,11 +4,11 @@ namespace PyroFetes.Models; public class Communication { - [Key] public int Id { get; set; } + [Key] public int Id { get; set; } [Required, MaxLength(100)] public string? Calling { get; set; } [Required, MaxLength(100)] public string? Email { get; set; } [Required, MaxLength(300)] public string? Meeting { get; set; } - + [Required] public int ContactId { get; set; } public Contact? Contact { get; set; } } \ No newline at end of file diff --git a/PyroFetes/Models/Contact.cs b/PyroFetes/Models/Contact.cs index e1573ad..e693559 100644 --- a/PyroFetes/Models/Contact.cs +++ b/PyroFetes/Models/Contact.cs @@ -13,10 +13,10 @@ public class Contact [Required] public int ZipCode { get; set; } [Required, MaxLength(100)] public string? City { get; set; } [Required, MaxLength(100)] public string? Role { get; set; } - + public Customer? Customer { get; set; } [Required] public int CustomerId { get; set; } - + public List? Communications { get; set; } public List? StaffContacts { get; set; } public List? ContactServiceProviders { get; set; } diff --git a/PyroFetes/Models/ContactServiceProvider.cs b/PyroFetes/Models/ContactServiceProvider.cs index cc9cd1b..f936ba6 100644 --- a/PyroFetes/Models/ContactServiceProvider.cs +++ b/PyroFetes/Models/ContactServiceProvider.cs @@ -8,7 +8,7 @@ public class ContactServiceProvider { [Required] public int ContactId { get; set; } [Required] public int ServiceProviderId { get; set; } - + public Contact? Contact { get; set; } public ServiceProvider? ServiceProvider { get; set; } } \ No newline at end of file diff --git a/PyroFetes/Models/Customer.cs b/PyroFetes/Models/Customer.cs index da6dbba..03a1092 100644 --- a/PyroFetes/Models/Customer.cs +++ b/PyroFetes/Models/Customer.cs @@ -6,11 +6,11 @@ public class Customer { [Key] public int Id { get; set; } [Required, MaxLength(200)] public string? Note { get; set; } - + //Relations [Required] public int CustomerTypeId { get; set; } public CustomerType? CustomerType { get; set; } - + public List? Contacts { get; set; } public List? Quotations { get; set; } -} +} \ No newline at end of file diff --git a/PyroFetes/Models/CustomerType.cs b/PyroFetes/Models/CustomerType.cs index 197ad09..2f6aec9 100644 --- a/PyroFetes/Models/CustomerType.cs +++ b/PyroFetes/Models/CustomerType.cs @@ -4,8 +4,8 @@ namespace PyroFetes.Models; public class CustomerType { - [Key] public int Id { get; set; } + [Key] public int Id { get; set; } [Required, MaxLength(100)] public string? Label { get; set; } - + public List? Customers { get; set; } } \ No newline at end of file diff --git a/PyroFetes/Models/Deliverer.cs b/PyroFetes/Models/Deliverer.cs index 34e708c..3ba10e8 100644 --- a/PyroFetes/Models/Deliverer.cs +++ b/PyroFetes/Models/Deliverer.cs @@ -6,6 +6,6 @@ public class Deliverer { [Key] public int Id { get; set; } [Required, MaxLength(100)] public string? Transporter { get; set; } - + public List? DeliveryNotes { get; set; } } \ No newline at end of file diff --git a/PyroFetes/Models/DeliveryNote.cs b/PyroFetes/Models/DeliveryNote.cs index e94792f..9cf8e53 100644 --- a/PyroFetes/Models/DeliveryNote.cs +++ b/PyroFetes/Models/DeliveryNote.cs @@ -10,7 +10,7 @@ public class DeliveryNote [Required] public DateOnly EstimateDeliveryDate { get; set; } [Required] public DateOnly ExpeditionDate { get; set; } public DateOnly? RealDeliveryDate { get; set; } - + public Deliverer? Deliverer { get; set; } public List? ProductDeliveries { get; set; } } \ No newline at end of file diff --git a/PyroFetes/Models/Effect.cs b/PyroFetes/Models/Effect.cs index 0dcb87c..4f50922 100644 --- a/PyroFetes/Models/Effect.cs +++ b/PyroFetes/Models/Effect.cs @@ -4,8 +4,8 @@ namespace PyroFetes.Models; public class Effect { - [Key] public int Id { get; set; } - [Required, MaxLength(200)] public string? Label { get; set; } - + [Key] public int Id { get; set; } + [Required, MaxLength(200)] public string? Label { get; set; } + public List? ProductEffects { get; set; } } \ No newline at end of file diff --git a/PyroFetes/Models/ExperienceLevel.cs b/PyroFetes/Models/ExperienceLevel.cs index 923f757..a1014b8 100644 --- a/PyroFetes/Models/ExperienceLevel.cs +++ b/PyroFetes/Models/ExperienceLevel.cs @@ -6,7 +6,7 @@ public class ExperienceLevel { [Key] public int Id { get; set; } [Required, MaxLength(100)] public string? Label { get; set; } - + public Staff? Staff { get; set; } [Required] public int StaffId { get; set; } } \ No newline at end of file diff --git a/PyroFetes/Models/HistoryOfApproval.cs b/PyroFetes/Models/HistoryOfApproval.cs index c8fd073..039a63e 100644 --- a/PyroFetes/Models/HistoryOfApproval.cs +++ b/PyroFetes/Models/HistoryOfApproval.cs @@ -4,9 +4,9 @@ namespace PyroFetes.Models; public class HistoryOfApproval { - [Key] public int Id { get; set; } + [Key] public int Id { get; set; } [Required] public DateOnly DeliveryDate { get; set; } [Required] public DateOnly ExpirationDate { get; set; } - + public List? StaffHistoryOfApprovals { get; set; } } \ No newline at end of file diff --git a/PyroFetes/Models/Material.cs b/PyroFetes/Models/Material.cs index 224e5d5..b833090 100644 --- a/PyroFetes/Models/Material.cs +++ b/PyroFetes/Models/Material.cs @@ -4,13 +4,13 @@ namespace PyroFetes.Models; public class Material { - [Key] public int Id {get; set;} - [Required, MaxLength(100)] public string? Name {get; set;} - [Required] public int Quantity {get; set;} - - [Required] public int WarehouseId {get; set;} - public Warehouse? Warehouse {get; set;} - - public List? ShowMaterials {get; set;} - public List? MaterialWarehouses {get; set;} + [Key] public int Id { get; set; } + [Required, MaxLength(100)] public string? Name { get; set; } + [Required] public int Quantity { get; set; } + + [Required] public int WarehouseId { get; set; } + public Warehouse? Warehouse { get; set; } + + public List? ShowMaterials { get; set; } + public List? MaterialWarehouses { get; set; } } \ No newline at end of file diff --git a/PyroFetes/Models/MaterialWarehouse.cs b/PyroFetes/Models/MaterialWarehouse.cs index 4f49ba9..983188e 100644 --- a/PyroFetes/Models/MaterialWarehouse.cs +++ b/PyroFetes/Models/MaterialWarehouse.cs @@ -8,7 +8,7 @@ public class MaterialWarehouse { [Required] public int MaterialId { get; set; } [Required] public int WarehouseId { get; set; } - + public Material? Material { get; set; } public Warehouse? Warehouse { get; set; } } \ No newline at end of file diff --git a/PyroFetes/Models/Movement.cs b/PyroFetes/Models/Movement.cs index fe26f18..f5a39f0 100644 --- a/PyroFetes/Models/Movement.cs +++ b/PyroFetes/Models/Movement.cs @@ -4,16 +4,16 @@ namespace PyroFetes.Models; public class Movement { - [Key] public int Id { get; set; } - [Required] public DateTime Date { get; set; } - [Required] public DateTime Start {get; set;} - [Required] public DateTime Arrival {get; set;} - [Required] public int Quantity {get; set;} - + [Key] public int Id { get; set; } + [Required] public DateTime Date { get; set; } + [Required] public DateTime Start { get; set; } + [Required] public DateTime Arrival { get; set; } + [Required] public int Quantity { get; set; } + public List? Products { get; set; } - - public int? SourceWarehouseId {get; set;} - public Warehouse? SourceWarehouse {get; set;} - public int? DestinationWarehouseId {get; set;} - public Warehouse? DestinationWarehouse {get; set;} + + public int? SourceWarehouseId { get; set; } + public Warehouse? SourceWarehouse { get; set; } + public int? DestinationWarehouseId { get; set; } + public Warehouse? DestinationWarehouse { get; set; } } \ No newline at end of file diff --git a/PyroFetes/Models/Price.cs b/PyroFetes/Models/Price.cs index 2ee597e..0facca4 100644 --- a/PyroFetes/Models/Price.cs +++ b/PyroFetes/Models/Price.cs @@ -10,7 +10,7 @@ public class Price [Required] public int ProductId { get; set; } [Required] public int SupplierId { get; set; } [Required] public decimal SellingPrice { get; set; } - + public Product? Product { get; set; } public Supplier? Supplier { get; set; } } \ No newline at end of file diff --git a/PyroFetes/Models/Product.cs b/PyroFetes/Models/Product.cs index 88f52e4..b53cb03 100644 --- a/PyroFetes/Models/Product.cs +++ b/PyroFetes/Models/Product.cs @@ -7,7 +7,7 @@ namespace PyroFetes.Models [Key] public int Id { get; set; } [Required, MaxLength(20)] public string? Reference { get; set; } [Required, MaxLength(100)] public string? Name { get; set; } - [Required] public decimal Duration {get; set;} + [Required] public decimal Duration { get; set; } [Required] public int Caliber { get; set; } [Required, MaxLength(100)] public string? ApprovalNumber { get; set; } [Required] public decimal Weight { get; set; } @@ -22,9 +22,9 @@ namespace PyroFetes.Models [Required] public int ProductCategoryId { get; set; } public ProductCategory? ProductCategory { get; set; } - - [Required] public int MovementId {get; set;} - public Movement? Movement {get; set;} + + [Required] public int MovementId { get; set; } + public Movement? Movement { get; set; } public List? ProductDeliveries { get; set; } public List? Brands { get; set; } @@ -35,7 +35,5 @@ namespace PyroFetes.Models public List? QuotationProducts { get; set; } public List? WarehouseProducts { get; set; } public List? ProductTimecodes { get; set; } - - } } \ No newline at end of file diff --git a/PyroFetes/Models/ProductCategory.cs b/PyroFetes/Models/ProductCategory.cs index 79bd67f..d809d02 100644 --- a/PyroFetes/Models/ProductCategory.cs +++ b/PyroFetes/Models/ProductCategory.cs @@ -4,8 +4,8 @@ namespace PyroFetes.Models; public class ProductCategory { - [Key] public int Id { get; set; } - [Required, MaxLength(100)] public string? Label { get; set; } - + [Key] public int Id { get; set; } + [Required, MaxLength(100)] public string? Label { get; set; } + public List? Products { get; set; } } \ No newline at end of file diff --git a/PyroFetes/Models/ProductColor.cs b/PyroFetes/Models/ProductColor.cs index f93d964..14291d8 100644 --- a/PyroFetes/Models/ProductColor.cs +++ b/PyroFetes/Models/ProductColor.cs @@ -8,7 +8,7 @@ public class ProductColor { public Product? Product { get; set; } [Required] public int ProductId { get; set; } - + public Color? Color { get; set; } [Required] public int ColorId { get; set; } } \ No newline at end of file diff --git a/PyroFetes/Models/ProductDelivery.cs b/PyroFetes/Models/ProductDelivery.cs index bfbae68..03d7c36 100644 --- a/PyroFetes/Models/ProductDelivery.cs +++ b/PyroFetes/Models/ProductDelivery.cs @@ -9,7 +9,7 @@ public class ProductDelivery [Required] public int ProductId { get; set; } [Required] public int DeliveryNoteId { get; set; } [Required] public int Quantity { get; set; } - + public Product? Product { get; set; } public DeliveryNote? DeliveryNote { get; set; } } \ No newline at end of file diff --git a/PyroFetes/Models/ProductEffect.cs b/PyroFetes/Models/ProductEffect.cs index 3f269d6..d81e952 100644 --- a/PyroFetes/Models/ProductEffect.cs +++ b/PyroFetes/Models/ProductEffect.cs @@ -11,5 +11,4 @@ public class ProductEffect public Effect? Effect { get; set; } [Required] public int EffectId { get; set; } - } \ No newline at end of file diff --git a/PyroFetes/Models/ProductTimecode.cs b/PyroFetes/Models/ProductTimecode.cs index a4ad826..b9979af 100644 --- a/PyroFetes/Models/ProductTimecode.cs +++ b/PyroFetes/Models/ProductTimecode.cs @@ -8,10 +8,10 @@ public class ProductTimecode { public Product? Product { get; set; } [Required] public int ProductId { get; set; } - + public Show? Show { get; set; } [Required] public int ShowId { get; set; } - + [Required] public decimal Start { get; set; } [Required] public decimal End { get; set; } } \ No newline at end of file diff --git a/PyroFetes/Models/ProviderType.cs b/PyroFetes/Models/ProviderType.cs index 0871b8a..0fb7821 100644 --- a/PyroFetes/Models/ProviderType.cs +++ b/PyroFetes/Models/ProviderType.cs @@ -4,8 +4,8 @@ namespace PyroFetes.Models; public class ProviderType { - [Key] public int Id { get; set; } + [Key] public int Id { get; set; } [Required, MaxLength(100)] public string? Label { get; set; } - + public List? ServiceProviders { get; set; } } \ No newline at end of file diff --git a/PyroFetes/Models/PurchaseOrder.cs b/PyroFetes/Models/PurchaseOrder.cs index 94a2ab6..0f54419 100644 --- a/PyroFetes/Models/PurchaseOrder.cs +++ b/PyroFetes/Models/PurchaseOrder.cs @@ -6,7 +6,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; } diff --git a/PyroFetes/Models/Quotation.cs b/PyroFetes/Models/Quotation.cs index 569c271..a732b8f 100644 --- a/PyroFetes/Models/Quotation.cs +++ b/PyroFetes/Models/Quotation.cs @@ -7,9 +7,9 @@ public class Quotation [Key] public int Id { get; set; } [Required, MaxLength(200)] public string? Message { get; set; } [Required, MaxLength(300)] public string? ConditionsSale { get; set; } - + [Required] public int CustomerId { get; set; } public Customer? Customer { get; set; } - + public List? QuotationProducts { get; set; } } \ No newline at end of file diff --git a/PyroFetes/Models/QuotationProduct.cs b/PyroFetes/Models/QuotationProduct.cs index 8e2f3bb..db88e63 100644 --- a/PyroFetes/Models/QuotationProduct.cs +++ b/PyroFetes/Models/QuotationProduct.cs @@ -8,8 +8,8 @@ public class QuotationProduct { [Required] public int ProductId { get; set; } [Required] public int QuotationId { get; set; } - [Required] public int Quantity { get; set; } - + [Required] public int Quantity { get; set; } + public Product? Product { get; set; } public Quotation? Quotation { get; set; } } \ No newline at end of file diff --git a/PyroFetes/Models/ServiceProvider.cs b/PyroFetes/Models/ServiceProvider.cs index b91e0d7..64e6272 100644 --- a/PyroFetes/Models/ServiceProvider.cs +++ b/PyroFetes/Models/ServiceProvider.cs @@ -4,13 +4,13 @@ namespace PyroFetes.Models; public class ServiceProvider { - [Key] public int Id { get; set; } + [Key] public int Id { get; set; } [Required] public decimal Price { get; set; } - + //Relations [Required] public int ProviderTypeId { get; set; } public ProviderType? ProviderType { get; set; } - + public List? Contracts { get; set; } public List? ContactServiceProviders { get; set; } } \ No newline at end of file diff --git a/PyroFetes/Models/Show.cs b/PyroFetes/Models/Show.cs index bc425dd..33ae713 100644 --- a/PyroFetes/Models/Show.cs +++ b/PyroFetes/Models/Show.cs @@ -9,13 +9,13 @@ public class Show [Required, MaxLength(120)] public string? Place { get; set; } [MaxLength(500)] public string? Description { get; set; } public DateOnly? Date { get; set; } - + // Link (path/URL/file name) to the pyrotechnic implementation plan [Required, MaxLength(500)] public string? PyrotechnicImplementationPlan { get; set; } - + [Required] public int CityId { get; set; } public City? City { get; set; } - + public List? ShowStaffs { get; set; } public List? ShowTrucks { get; set; } public List? SoundTimecodes { get; set; } diff --git a/PyroFetes/Models/ShowMaterial.cs b/PyroFetes/Models/ShowMaterial.cs index 81cc82a..b28de28 100644 --- a/PyroFetes/Models/ShowMaterial.cs +++ b/PyroFetes/Models/ShowMaterial.cs @@ -11,5 +11,4 @@ public class ShowMaterial public Material? Material { get; set; } [Required] public int MaterialId { get; set; } - } \ No newline at end of file diff --git a/PyroFetes/Models/ShowServiceProvider.cs b/PyroFetes/Models/ShowServiceProvider.cs index 351c9fc..3580426 100644 --- a/PyroFetes/Models/ShowServiceProvider.cs +++ b/PyroFetes/Models/ShowServiceProvider.cs @@ -4,6 +4,5 @@ namespace PyroFetes.Models; public class ShowServiceProvider { - [Key] public int Id { get; set; } - + [Key] public int Id { get; set; } } \ No newline at end of file diff --git a/PyroFetes/Models/Sound.cs b/PyroFetes/Models/Sound.cs index 3ddee3e..71e16c2 100644 --- a/PyroFetes/Models/Sound.cs +++ b/PyroFetes/Models/Sound.cs @@ -12,9 +12,9 @@ public class Sound [Required, MaxLength(40)] public string? Kind { get; set; } [Required, MaxLength(40)] public string? Format { get; set; } public DateTime? CreationDate { get; set; } - + [Required] public int SoundCategoryId { get; set; } public SoundCategory? SoundCategory { get; set; } - + public List? SoundTimecodes { get; set; } } \ No newline at end of file diff --git a/PyroFetes/Models/SoundCategory.cs b/PyroFetes/Models/SoundCategory.cs index 52caeaf..b73b8cc 100644 --- a/PyroFetes/Models/SoundCategory.cs +++ b/PyroFetes/Models/SoundCategory.cs @@ -6,6 +6,6 @@ public class SoundCategory { [Key] public int Id { get; set; } [Required, MaxLength(100)] public string Name { get; set; } = null!; - + public List? Sounds { get; set; } } \ No newline at end of file diff --git a/PyroFetes/Models/SoundTimecode.cs b/PyroFetes/Models/SoundTimecode.cs index 3411e0c..8ab47c3 100644 --- a/PyroFetes/Models/SoundTimecode.cs +++ b/PyroFetes/Models/SoundTimecode.cs @@ -10,7 +10,7 @@ public class SoundTimecode public Show? Show { get; set; } [Required] public int SoundId { get; set; } public Sound? Sound { get; set; } - + [Required] public decimal Start { get; set; } [Required] public decimal End { get; set; } } \ No newline at end of file diff --git a/PyroFetes/Models/Staff.cs b/PyroFetes/Models/Staff.cs index a95c455..b50df53 100644 --- a/PyroFetes/Models/Staff.cs +++ b/PyroFetes/Models/Staff.cs @@ -11,7 +11,7 @@ public class Staff [Required, MaxLength(120)] public string? Email { get; set; } [Required, MaxLength(100)] public string? F4T2NumberApproval { get; set; } [Required] public DateOnly F4T2ExpirationDate { get; set; } - + public List? ShowStaffs { get; set; } public List? ExperienceLevels { get; set; } public List? StaffAvailabilities { get; set; } diff --git a/PyroFetes/Models/Supplier.cs b/PyroFetes/Models/Supplier.cs index 539b1b4..18c6694 100644 --- a/PyroFetes/Models/Supplier.cs +++ b/PyroFetes/Models/Supplier.cs @@ -9,9 +9,9 @@ public class Supplier [Required, MaxLength(100)] public string? Email { get; set; } [Required, MaxLength(30)] public string? Phone { get; set; } [Required, MaxLength(100)] public string? Address { get; set; } - [Required,Length(5,5)] public string? ZipCode { get; set; } + [Required, Length(5, 5)] public string? ZipCode { get; set; } [Required, MaxLength(100)] public string? City { get; set; } [Required] public int DeliveryDelay { get; set; } - + public List? Prices { get; set; } } \ No newline at end of file diff --git a/PyroFetes/Models/Truck.cs b/PyroFetes/Models/Truck.cs index 91794a9..8a11b07 100644 --- a/PyroFetes/Models/Truck.cs +++ b/PyroFetes/Models/Truck.cs @@ -9,6 +9,6 @@ public class Truck [Required] public double? MaxExplosiveCapacity { get; set; } [Required, MaxLength(80)] public string? Sizes { get; set; } [Required, MaxLength(40)] public string? Status { get; set; } - + public List? ShowTrucks { get; set; } } \ No newline at end of file diff --git a/PyroFetes/Models/Warehouse.cs b/PyroFetes/Models/Warehouse.cs index d1e6420..0de0a12 100644 --- a/PyroFetes/Models/Warehouse.cs +++ b/PyroFetes/Models/Warehouse.cs @@ -4,19 +4,19 @@ namespace PyroFetes.Models; public class Warehouse { - [Key] public int Id {get; set;} - [Required, MaxLength(100)] public string? Name {get; set;} - [Required] public int MaxWeight {get; set;} - [Required] public int Current {get; set;} - [Required] public int MinWeight {get; set;} + [Key] public int Id { get; set; } + [Required, MaxLength(100)] public string? Name { get; set; } + [Required] public int MaxWeight { get; set; } + [Required] public int Current { get; set; } + [Required] public int MinWeight { get; set; } [Required, MaxLength(100)] public string? Address { get; set; } - [Required, Length(5,5)] public string? ZipCode { get; set; } + [Required, Length(5, 5)] public string? ZipCode { get; set; } [Required, MaxLength(100)] public string? City { get; set; } - + public List? WarehouseProducts { get; set; } - - public List? MaterialWarehouses {get; set;} - + + public List? MaterialWarehouses { get; set; } + public List? MovementsSource { get; set; } public List? MovementsDestination { get; set; } } \ No newline at end of file diff --git a/PyroFetes/Models/WarehouseProduct.cs b/PyroFetes/Models/WarehouseProduct.cs index fe89d36..cabc07c 100644 --- a/PyroFetes/Models/WarehouseProduct.cs +++ b/PyroFetes/Models/WarehouseProduct.cs @@ -10,6 +10,6 @@ public class WarehouseProduct public Product? Product { get; set; } [Required] public int WarehouseId { get; set; } public Warehouse? Warehouse { get; set; } - + [Required] public int Quantity { get; set; } } \ No newline at end of file diff --git a/PyroFetes/Program.cs b/PyroFetes/Program.cs index b056413..ac75892 100644 --- a/PyroFetes/Program.cs +++ b/PyroFetes/Program.cs @@ -20,10 +20,7 @@ builder.Services .AddAuthenticationJwtBearer(s => s.SigningKey = "ThisIsASuperSecretJwtKeyThatIsAtLeast32CharsLong") .AddAuthorization() .AddFastEndpoints() - .SwaggerDocument(options => - { - options.ShortSchemaNames = true; - }) + .SwaggerDocument(options => { options.ShortSchemaNames = true; }) .AddCors(options => { options.AddDefaultPolicy(policyBuilder => diff --git a/PyroFetes/PyroFetesDbContext.cs b/PyroFetes/PyroFetesDbContext.cs index 7d8c900..9a278ac 100644 --- a/PyroFetes/PyroFetesDbContext.cs +++ b/PyroFetes/PyroFetesDbContext.cs @@ -71,7 +71,7 @@ public class PyroFetesDbContext : DbContext optionsBuilder.UseSqlServer(connectionString); } - + // Models customization protected override void OnModelCreating(ModelBuilder modelBuilder) { @@ -80,13 +80,13 @@ public class PyroFetesDbContext : DbContext .WithMany(w => w.MovementsSource) .HasForeignKey(m => m.SourceWarehouseId) .OnDelete(DeleteBehavior.Restrict); - + modelBuilder.Entity() .HasOne(m => m.DestinationWarehouse) .WithMany(w => w.MovementsDestination) .HasForeignKey(m => m.DestinationWarehouseId) .OnDelete(DeleteBehavior.Restrict); - + modelBuilder.Entity() .HasOne(mw => mw.Material) .WithMany(m => m.MaterialWarehouses) diff --git a/PyroFetes/Repositories/DeliverersRepository.cs b/PyroFetes/Repositories/DeliverersRepository.cs index 0bf8c2e..6d1ff5e 100644 --- a/PyroFetes/Repositories/DeliverersRepository.cs +++ b/PyroFetes/Repositories/DeliverersRepository.cs @@ -2,4 +2,4 @@ using PyroFetes.Models; namespace PyroFetes.Repositories; -public class DeliverersRepository(PyroFetesDbContext pyrofetesContext, AutoMapper.IMapper mapper) : PyrofetesRepository(pyrofetesContext, mapper); +public class DeliverersRepository(PyroFetesDbContext pyrofetesContext, AutoMapper.IMapper mapper) : PyrofetesRepository(pyrofetesContext, mapper); \ No newline at end of file diff --git a/PyroFetes/Repositories/QuotationProductsRepository.cs b/PyroFetes/Repositories/QuotationProductsRepository.cs index 0d42cdc..4bae3f0 100644 --- a/PyroFetes/Repositories/QuotationProductsRepository.cs +++ b/PyroFetes/Repositories/QuotationProductsRepository.cs @@ -2,4 +2,4 @@ using PyroFetes.Models; namespace PyroFetes.Repositories; -public class QuotationProductsRepository(PyroFetesDbContext pyrofetesContext, AutoMapper.IMapper mapper) : PyrofetesRepository(pyrofetesContext, mapper); +public class QuotationProductsRepository(PyroFetesDbContext pyrofetesContext, AutoMapper.IMapper mapper) : PyrofetesRepository(pyrofetesContext, mapper); \ No newline at end of file diff --git a/PyroFetes/Services/Pdf/DeliveryNotePdfService.cs b/PyroFetes/Services/Pdf/DeliveryNotePdfService.cs index eae9b7e..8435455 100644 --- a/PyroFetes/Services/Pdf/DeliveryNotePdfService.cs +++ b/PyroFetes/Services/Pdf/DeliveryNotePdfService.cs @@ -78,10 +78,10 @@ public class DeliveryNotePdfService : IDeliveryNotePdfService { table.ColumnsDefinition(columns => { - columns.RelativeColumn(4); // Produit - columns.RelativeColumn(2); // Qté - columns.RelativeColumn(2); // PU - columns.RelativeColumn(2); // Total + columns.RelativeColumn(4); // Produit + columns.RelativeColumn(2); // Qté + columns.RelativeColumn(2); // PU + columns.RelativeColumn(2); // Total }); // En-têtes @@ -92,16 +92,16 @@ public class DeliveryNotePdfService : IDeliveryNotePdfService header.Cell().Element(CellHeader).AlignRight().Text("PU"); header.Cell().Element(CellHeader).AlignRight().Text("Total"); }); - + foreach (ProductDelivery l in lignes) { 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} €"); - + totalQuantity += l.Quantity; - total += l.Quantity * l.Quantity; + total += l.Quantity * l.Quantity; } IContainer CellHeader(IContainer c) => @@ -121,13 +121,10 @@ public class DeliveryNotePdfService : IDeliveryNotePdfService }); // Signature en bas à droite - page.Footer().AlignRight().Column(col => - { - col.Item().AlignRight().Height(100).Image(signature, ImageScaling.FitArea); - }); + page.Footer().AlignRight().Column(col => { col.Item().AlignRight().Height(100).Image(signature, ImageScaling.FitArea); }); }); }); return document.GeneratePdf(); } -} +} \ No newline at end of file diff --git a/PyroFetes/Services/Pdf/PurchaseOrderPdfService.cs b/PyroFetes/Services/Pdf/PurchaseOrderPdfService.cs index c5ef60e..6fe2e7a 100644 --- a/PyroFetes/Services/Pdf/PurchaseOrderPdfService.cs +++ b/PyroFetes/Services/Pdf/PurchaseOrderPdfService.cs @@ -75,10 +75,10 @@ public class PurchaseOrderPdfService : IPurchaseOrderPdfService { table.ColumnsDefinition(columns => { - columns.RelativeColumn(4); // Produit - columns.RelativeColumn(1); // Qté - columns.RelativeColumn(2); // PU - columns.RelativeColumn(2); // Total + columns.RelativeColumn(4); // Produit + columns.RelativeColumn(1); // Qté + columns.RelativeColumn(2); // PU + columns.RelativeColumn(2); // Total }); // En-têtes @@ -89,20 +89,20 @@ public class PurchaseOrderPdfService : IPurchaseOrderPdfService header.Cell().Element(CellHeader).AlignRight().Text("PU"); header.Cell().Element(CellHeader).AlignRight().Text("Total"); }); - + foreach (PurchaseProduct 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($"{price:n2} €"); table.Cell().Element(CellBody).AlignRight().Text($"{l.Quantity * price:n2} €"); - + totalQuantity += l.Quantity; - total += l.Quantity * price; + total += l.Quantity * price; } IContainer CellHeader(IContainer c) => @@ -132,19 +132,16 @@ 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} €"); }); }); }); // Signature en bas à droite - page.Footer().AlignRight().Column(col => - { - col.Item().AlignRight().Height(100).Image(signature, ImageScaling.FitArea); - }); + page.Footer().AlignRight().Column(col => { col.Item().AlignRight().Height(100).Image(signature, ImageScaling.FitArea); }); }); }); return document.GeneratePdf(); } -} +} \ No newline at end of file diff --git a/PyroFetes/Services/Pdf/QuotationPdfService.cs b/PyroFetes/Services/Pdf/QuotationPdfService.cs index 40e4b75..8bc5557 100644 --- a/PyroFetes/Services/Pdf/QuotationPdfService.cs +++ b/PyroFetes/Services/Pdf/QuotationPdfService.cs @@ -74,10 +74,10 @@ public class QuotationPdfService : IQuotationPdfService { table.ColumnsDefinition(columns => { - columns.RelativeColumn(10); // Produit - columns.RelativeColumn(2); // Qté - columns.RelativeColumn(3); // PU - columns.RelativeColumn(3); // Total + columns.RelativeColumn(10); // Produit + columns.RelativeColumn(2); // Qté + columns.RelativeColumn(3); // PU + columns.RelativeColumn(3); // Total }); // En-têtes @@ -88,15 +88,15 @@ public class QuotationPdfService : IQuotationPdfService header.Cell().Element(CellHeader).AlignRight().Text("PU"); header.Cell().Element(CellHeader).AlignRight().Text("Total"); }); - + foreach (QuotationProduct l in lignes) { 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} €"); - - total = total + l.Quantity * l.Quantity; + + total = total + l.Quantity * l.Quantity; } IContainer CellHeader(IContainer c) => @@ -131,16 +131,13 @@ public class QuotationPdfService : IQuotationPdfService }); // Signature en bas à droite - page.Footer().AlignRight().Column(col => - { - col.Item().AlignRight().Height(100).Image(signature, ImageScaling.FitArea); - }); + page.Footer().AlignRight().Column(col => { col.Item().AlignRight().Height(100).Image(signature, ImageScaling.FitArea); }); }); }); - + // Pour avoir la vue du PDF en temps réel // document.ShowInCompanion(); return document.GeneratePdf(); } -} +} \ No newline at end of file diff --git a/PyroFetes/Specifications/PurchaseOrders/GetPurchaseOrderByIdWithProductsSpec.cs b/PyroFetes/Specifications/PurchaseOrders/GetPurchaseOrderByIdWithProductsSpec.cs index 5b1ae68..8158a7f 100644 --- a/PyroFetes/Specifications/PurchaseOrders/GetPurchaseOrderByIdWithProductsSpec.cs +++ b/PyroFetes/Specifications/PurchaseOrders/GetPurchaseOrderByIdWithProductsSpec.cs @@ -11,6 +11,6 @@ public class GetPurchaseOrderByIdWithProductsSpec : SingleResultSpecification x.Id == purchaseOrderId) .Include(x => x.PurchaseProducts!) .ThenInclude(p => p.Product) - .ThenInclude(p=> p!.Prices); + .ThenInclude(p => p!.Prices); } -} \ No newline at end of file +} \ No newline at end of file diff --git a/PyroFetes/Specifications/PurchaseProducts/GetPurchaseProductByProductIdAndPurchaseOrderIdSpec.cs b/PyroFetes/Specifications/PurchaseProducts/GetPurchaseProductByProductIdAndPurchaseOrderIdSpec.cs index 2d801b6..45e4f6e 100644 --- a/PyroFetes/Specifications/PurchaseProducts/GetPurchaseProductByProductIdAndPurchaseOrderIdSpec.cs +++ b/PyroFetes/Specifications/PurchaseProducts/GetPurchaseProductByProductIdAndPurchaseOrderIdSpec.cs @@ -5,7 +5,7 @@ namespace PyroFetes.Specifications.PurchaseProducts; public sealed class GetPurchaseProductByProductIdAndPurchaseOrderIdSpec : SingleResultSpecification { - public GetPurchaseProductByProductIdAndPurchaseOrderIdSpec(int productId, int purchaseOrderId) + public GetPurchaseProductByProductIdAndPurchaseOrderIdSpec(int productId, int purchaseOrderId) { Query .Where(p => p.ProductId == productId && p.PurchaseOrderId == purchaseOrderId); diff --git a/PyroFetes/Specifications/Users/GetUserByNameSpec.cs b/PyroFetes/Specifications/Users/GetUserByNameSpec.cs index 2affac1..78edf1f 100644 --- a/PyroFetes/Specifications/Users/GetUserByNameSpec.cs +++ b/PyroFetes/Specifications/Users/GetUserByNameSpec.cs @@ -8,6 +8,6 @@ public sealed class GetUserByNameSpec : SingleResultSpecification public GetUserByNameSpec(string userName) { Query - .Where(x=> x.Name == userName); + .Where(x => x.Name == userName); } } \ No newline at end of file diff --git a/PyroFetes/Specifications/WarehouseProducts/GetProductTotalQuantitySpec.cs b/PyroFetes/Specifications/WarehouseProducts/GetProductTotalQuantitySpec.cs index 9dd451f..c860c36 100644 --- a/PyroFetes/Specifications/WarehouseProducts/GetProductTotalQuantitySpec.cs +++ b/PyroFetes/Specifications/WarehouseProducts/GetProductTotalQuantitySpec.cs @@ -9,6 +9,5 @@ public sealed class GetProductTotalQuantitySpec : Specification wp.ProductId == productId); - } } \ No newline at end of file From 1ae807221947eb82a3dfb6dd9be66318f2c58a97 Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Mon, 25 May 2026 11:09:01 +0100 Subject: [PATCH 27/51] Fixed error with documentId --- PyroFetes/DTO/PurchaseProduct/Response/GetPurchaseProductDto.cs | 2 ++ .../DTO/QuotationProduct/Response/GetQuotationProductDto.cs | 1 + 2 files changed, 3 insertions(+) diff --git a/PyroFetes/DTO/PurchaseProduct/Response/GetPurchaseProductDto.cs b/PyroFetes/DTO/PurchaseProduct/Response/GetPurchaseProductDto.cs index 3a61081..80bccec 100644 --- a/PyroFetes/DTO/PurchaseProduct/Response/GetPurchaseProductDto.cs +++ b/PyroFetes/DTO/PurchaseProduct/Response/GetPurchaseProductDto.cs @@ -14,6 +14,8 @@ public class GetPurchaseProductDto public string? ProductLink { get; set; } public int ProductMinimalQuantity { get; set; } public decimal ProductPrice { get; set; } + + public int PurchaseOrderId { get; set; } public int Quantity { get; set; } } \ No newline at end of file diff --git a/PyroFetes/DTO/QuotationProduct/Response/GetQuotationProductDto.cs b/PyroFetes/DTO/QuotationProduct/Response/GetQuotationProductDto.cs index 06f8ef5..338c16c 100644 --- a/PyroFetes/DTO/QuotationProduct/Response/GetQuotationProductDto.cs +++ b/PyroFetes/DTO/QuotationProduct/Response/GetQuotationProductDto.cs @@ -15,4 +15,5 @@ public class GetQuotationProductDto public string? ProductImage { get; set; } public string? ProductLink { get; set; } public int ProductMinimalQuantity { get; set; } + public int QuotationId { get; set; } } \ No newline at end of file From b59a8b6c3d9afcfe1ac656de8a8a134316b9db8c Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Mon, 25 May 2026 11:44:18 +0100 Subject: [PATCH 28/51] Added missing field to display price of products on quotation and purchase order --- .../Response/GetPurchaseOrderDto.cs | 2 +- .../Response/GetQuotationProductDto.cs | 1 + .../MappingProfiles/EntityToDtoMappings.cs | 13 +- ...ingFieldForSupplierInDocuments.Designer.cs | 2000 +++++++++++++++++ ...AddedMissingFieldForSupplierInDocuments.cs | 50 + .../PyroFetesDbContextModelSnapshot.cs | 19 +- PyroFetes/Models/Quotation.cs | 3 + PyroFetes/Models/Supplier.cs | 4 +- 8 files changed, 2086 insertions(+), 6 deletions(-) create mode 100644 PyroFetes/Migrations/20260525103910_AddedMissingFieldForSupplierInDocuments.Designer.cs create mode 100644 PyroFetes/Migrations/20260525103910_AddedMissingFieldForSupplierInDocuments.cs diff --git a/PyroFetes/DTO/PurchaseOrder/Response/GetPurchaseOrderDto.cs b/PyroFetes/DTO/PurchaseOrder/Response/GetPurchaseOrderDto.cs index f2d626a..f498c64 100644 --- a/PyroFetes/DTO/PurchaseOrder/Response/GetPurchaseOrderDto.cs +++ b/PyroFetes/DTO/PurchaseOrder/Response/GetPurchaseOrderDto.cs @@ -6,6 +6,6 @@ public class GetPurchaseOrderDto { public int Id { get; set; } public string? PurchaseConditions { get; set; } - public int SupplierId { get; set; } + public string? SupplierName { get; set; } public List? Products { get; set; } } \ No newline at end of file diff --git a/PyroFetes/DTO/QuotationProduct/Response/GetQuotationProductDto.cs b/PyroFetes/DTO/QuotationProduct/Response/GetQuotationProductDto.cs index 338c16c..08a8d6b 100644 --- a/PyroFetes/DTO/QuotationProduct/Response/GetQuotationProductDto.cs +++ b/PyroFetes/DTO/QuotationProduct/Response/GetQuotationProductDto.cs @@ -15,5 +15,6 @@ public class GetQuotationProductDto public string? ProductImage { get; set; } public string? ProductLink { get; set; } public int ProductMinimalQuantity { get; set; } + public decimal ProductPrice { get; set; } public int QuotationId { get; set; } } \ No newline at end of file diff --git a/PyroFetes/MappingProfiles/EntityToDtoMappings.cs b/PyroFetes/MappingProfiles/EntityToDtoMappings.cs index b312e96..0e10014 100644 --- a/PyroFetes/MappingProfiles/EntityToDtoMappings.cs +++ b/PyroFetes/MappingProfiles/EntityToDtoMappings.cs @@ -35,15 +35,22 @@ public class EntityToDtoMappings : Profile CreateMap(); CreateMap() + .ForMember(dest => dest.SupplierName, opt => opt.MapFrom(src => src.Supplier!.Name)) .ForMember(dest => dest.Products, opt => opt.MapFrom(src => src.PurchaseProducts)); - CreateMap(); + CreateMap() + .ForMember(dest => dest.ProductPrice, + opt => opt.MapFrom(src => + src.Product!.Prices.Where(x => x.SupplierId == src.PurchaseOrder!.SupplierId && x.ProductId == src.ProductId).Select(x => x.SellingPrice).FirstOrDefault())); CreateMap() .ForMember(dest => dest.Products, opt => opt.MapFrom(src => src.QuotationProducts)); - CreateMap(); - + CreateMap() + .ForMember(dest => dest.ProductPrice, + opt => opt.MapFrom(src => + src.Product!.Prices.Where(x => x.SupplierId == src.Quotation!.SupplierId && x.ProductId == src.ProductId).Select(x => x.SellingPrice).FirstOrDefault())); + CreateMap(); CreateMap(); diff --git a/PyroFetes/Migrations/20260525103910_AddedMissingFieldForSupplierInDocuments.Designer.cs b/PyroFetes/Migrations/20260525103910_AddedMissingFieldForSupplierInDocuments.Designer.cs new file mode 100644 index 0000000..12daab0 --- /dev/null +++ b/PyroFetes/Migrations/20260525103910_AddedMissingFieldForSupplierInDocuments.Designer.cs @@ -0,0 +1,2000 @@ +// +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("20260525103910_AddedMissingFieldForSupplierInDocuments")] + partial class AddedMissingFieldForSupplierInDocuments + { + /// + 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.Property("SupplierId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("SupplierId"); + + 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.Property("SupplierId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("CustomerId"); + + b.HasIndex("SupplierId"); + + 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.PurchaseOrder", b => + { + b.HasOne("PyroFetes.Models.Supplier", "Supplier") + .WithMany("PurchaseOrders") + .HasForeignKey("SupplierId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Supplier"); + }); + + 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.HasOne("PyroFetes.Models.Supplier", "Supplier") + .WithMany("Quotations") + .HasForeignKey("SupplierId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Customer"); + + b.Navigation("Supplier"); + }); + + 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"); + + b.Navigation("PurchaseOrders"); + + b.Navigation("Quotations"); + }); + + 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/20260525103910_AddedMissingFieldForSupplierInDocuments.cs b/PyroFetes/Migrations/20260525103910_AddedMissingFieldForSupplierInDocuments.cs new file mode 100644 index 0000000..297a91a --- /dev/null +++ b/PyroFetes/Migrations/20260525103910_AddedMissingFieldForSupplierInDocuments.cs @@ -0,0 +1,50 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace PyroFetes.Migrations +{ + /// + public partial class AddedMissingFieldForSupplierInDocuments : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "SupplierId", + table: "Quotations", + type: "int", + nullable: false, + defaultValue: 0); + + migrationBuilder.CreateIndex( + name: "IX_Quotations_SupplierId", + table: "Quotations", + column: "SupplierId"); + + migrationBuilder.AddForeignKey( + name: "FK_Quotations_Suppliers_SupplierId", + table: "Quotations", + column: "SupplierId", + principalTable: "Suppliers", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropForeignKey( + name: "FK_Quotations_Suppliers_SupplierId", + table: "Quotations"); + + migrationBuilder.DropIndex( + name: "IX_Quotations_SupplierId", + table: "Quotations"); + + migrationBuilder.DropColumn( + name: "SupplierId", + table: "Quotations"); + } + } +} diff --git a/PyroFetes/Migrations/PyroFetesDbContextModelSnapshot.cs b/PyroFetes/Migrations/PyroFetesDbContextModelSnapshot.cs index 571eef5..d0b5a2c 100644 --- a/PyroFetes/Migrations/PyroFetesDbContextModelSnapshot.cs +++ b/PyroFetes/Migrations/PyroFetesDbContextModelSnapshot.cs @@ -744,10 +744,15 @@ namespace PyroFetes.Migrations .HasMaxLength(200) .HasColumnType("nvarchar(200)"); + b.Property("SupplierId") + .HasColumnType("int"); + b.HasKey("Id"); b.HasIndex("CustomerId"); + b.HasIndex("SupplierId"); + b.ToTable("Quotations"); }); @@ -1553,7 +1558,7 @@ namespace PyroFetes.Migrations modelBuilder.Entity("PyroFetes.Models.PurchaseOrder", b => { b.HasOne("PyroFetes.Models.Supplier", "Supplier") - .WithMany() + .WithMany("PurchaseOrders") .HasForeignKey("SupplierId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); @@ -1588,7 +1593,15 @@ namespace PyroFetes.Migrations .OnDelete(DeleteBehavior.Cascade) .IsRequired(); + b.HasOne("PyroFetes.Models.Supplier", "Supplier") + .WithMany("Quotations") + .HasForeignKey("SupplierId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + b.Navigation("Customer"); + + b.Navigation("Supplier"); }); modelBuilder.Entity("PyroFetes.Models.QuotationProduct", b => @@ -1957,6 +1970,10 @@ namespace PyroFetes.Migrations modelBuilder.Entity("PyroFetes.Models.Supplier", b => { b.Navigation("Prices"); + + b.Navigation("PurchaseOrders"); + + b.Navigation("Quotations"); }); modelBuilder.Entity("PyroFetes.Models.Truck", b => diff --git a/PyroFetes/Models/Quotation.cs b/PyroFetes/Models/Quotation.cs index a732b8f..e8b9915 100644 --- a/PyroFetes/Models/Quotation.cs +++ b/PyroFetes/Models/Quotation.cs @@ -10,6 +10,9 @@ public class Quotation [Required] public int CustomerId { get; set; } public Customer? Customer { get; set; } + + [Required] public int SupplierId { get; set; } + public Supplier? Supplier { get; set; } public List? QuotationProducts { get; set; } } \ No newline at end of file diff --git a/PyroFetes/Models/Supplier.cs b/PyroFetes/Models/Supplier.cs index 18c6694..36b7247 100644 --- a/PyroFetes/Models/Supplier.cs +++ b/PyroFetes/Models/Supplier.cs @@ -13,5 +13,7 @@ public class Supplier [Required, MaxLength(100)] public string? City { get; set; } [Required] public int DeliveryDelay { get; set; } - public List? Prices { get; set; } + public List? Prices { get; set; } + public List? Quotations { get; set; } + public List? PurchaseOrders { get; set; } } \ No newline at end of file From d46fa606b7e2740074b139c0e2bcd4b3fd864d2c Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Mon, 25 May 2026 12:19:05 +0100 Subject: [PATCH 29/51] Fixed error with creation of document --- ...eateQuotationProductDto.cs => AddQuotationProductDto.cs} | 0 PyroFetes/Endpoints/PurchaseOrders/CreatePurchaseOrder.cs | 3 +-- PyroFetes/Endpoints/Quotations/CreateQuotationEndpoint.cs | 6 +++--- PyroFetes/Endpoints/Quotations/UpdateQuotationEndpoint.cs | 1 - PyroFetes/MappingProfiles/DtoToEntityMappings.cs | 6 +++++- 5 files changed, 9 insertions(+), 7 deletions(-) rename PyroFetes/DTO/QuotationProduct/Request/{CreateQuotationProductDto.cs => AddQuotationProductDto.cs} (100%) diff --git a/PyroFetes/DTO/QuotationProduct/Request/CreateQuotationProductDto.cs b/PyroFetes/DTO/QuotationProduct/Request/AddQuotationProductDto.cs similarity index 100% rename from PyroFetes/DTO/QuotationProduct/Request/CreateQuotationProductDto.cs rename to PyroFetes/DTO/QuotationProduct/Request/AddQuotationProductDto.cs diff --git a/PyroFetes/Endpoints/PurchaseOrders/CreatePurchaseOrder.cs b/PyroFetes/Endpoints/PurchaseOrders/CreatePurchaseOrder.cs index 0e5406c..6428158 100644 --- a/PyroFetes/Endpoints/PurchaseOrders/CreatePurchaseOrder.cs +++ b/PyroFetes/Endpoints/PurchaseOrders/CreatePurchaseOrder.cs @@ -23,6 +23,7 @@ public class CreatePurchaseOrder( public override async Task HandleAsync(CreatePurchaseOrderDto req, CancellationToken ct) { PurchaseOrder purchaseOrder = mapper.Map(req); + await purchaseOrdersRepository.AddAsync(purchaseOrder, ct); if (req.Products != null) { @@ -49,8 +50,6 @@ public class CreatePurchaseOrder( await purchaseProductsRepository.AddAsync(productOnPurchase, ct); } } - - await purchaseOrdersRepository.AddAsync(purchaseOrder, ct); await Send.NoContentAsync(ct); } } \ No newline at end of file diff --git a/PyroFetes/Endpoints/Quotations/CreateQuotationEndpoint.cs b/PyroFetes/Endpoints/Quotations/CreateQuotationEndpoint.cs index 1ec4e1f..f8b2f9a 100644 --- a/PyroFetes/Endpoints/Quotations/CreateQuotationEndpoint.cs +++ b/PyroFetes/Endpoints/Quotations/CreateQuotationEndpoint.cs @@ -1,6 +1,5 @@ using FastEndpoints; using PyroFetes.DTO.Quotation.Request; -using PyroFetes.DTO.Quotation.Response; using PyroFetes.DTO.QuotationProduct.Request; using PyroFetes.Models; using PyroFetes.Repositories; @@ -25,6 +24,7 @@ public class CreateQuotationEndpoint( { Quotation quotation = mapper.Map(req); quotation.CustomerId = 1; // TODO: A changer + await quotationsRepository.AddAsync(quotation, ct); if (req.Products != null) { @@ -43,6 +43,7 @@ public class CreateQuotationEndpoint( if (quotationProduct is not null) { await Send.StringAsync("Le produit est déjà dans le devis", 400, cancellation: ct); + return; } QuotationProduct? productOnQuotation = mapper.Map(line); @@ -51,8 +52,7 @@ public class CreateQuotationEndpoint( await quotationProductsRepository.AddAsync(productOnQuotation, ct); } } - - await quotationsRepository.AddAsync(quotation, ct); + await Send.NoContentAsync(ct); } } \ No newline at end of file diff --git a/PyroFetes/Endpoints/Quotations/UpdateQuotationEndpoint.cs b/PyroFetes/Endpoints/Quotations/UpdateQuotationEndpoint.cs index 703c69c..4284b5d 100644 --- a/PyroFetes/Endpoints/Quotations/UpdateQuotationEndpoint.cs +++ b/PyroFetes/Endpoints/Quotations/UpdateQuotationEndpoint.cs @@ -1,6 +1,5 @@ using FastEndpoints; using PyroFetes.DTO.Quotation.Request; -using PyroFetes.DTO.Quotation.Response; using PyroFetes.Models; using PyroFetes.Repositories; using PyroFetes.Specifications.Quotations; diff --git a/PyroFetes/MappingProfiles/DtoToEntityMappings.cs b/PyroFetes/MappingProfiles/DtoToEntityMappings.cs index 152d0c3..5b7d8b7 100644 --- a/PyroFetes/MappingProfiles/DtoToEntityMappings.cs +++ b/PyroFetes/MappingProfiles/DtoToEntityMappings.cs @@ -44,6 +44,7 @@ public class DtoToEntityMappings : Profile .ForMember(dest => dest.Id, opt => opt.Ignore()); CreateMap(); + CreateMap(); CreateMap() .ForMember(dest => dest.ProductId, opt => opt.Ignore()) .ForMember(dest => dest.PurchaseOrderId, opt => opt.Ignore()); @@ -52,7 +53,10 @@ public class DtoToEntityMappings : Profile .ForMember(dest => dest.Id, opt => opt.Ignore()); CreateMap() .ForMember(dest => dest.Id, opt => opt.Ignore()); - CreateMap(); + CreateMap(); + CreateMap(); + CreateMap() + .ForMember(dest => dest.Id, opt => opt.Ignore()); CreateMap(); CreateMap() From c0ac9f7a655f32638776a9ce1703ecfb1af89ac3 Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Mon, 25 May 2026 15:42:23 +0100 Subject: [PATCH 30/51] Fixed error with setting during conversion of base64 --- .../PatchSettingElectronicSignatureDto.cs | 1 - .../SettingDTO/Request/PatchSettingLogoDto.cs | 1 - .../Settings/CreateSettingEndpoint.cs | 35 ------------------- .../Settings/DeleteSettingEndpoint.cs | 34 ------------------ .../Endpoints/Settings/GetSettingEndpoint.cs | 16 +++------ ...PatchSettingElectronicSignatureEndpoint.cs | 6 ++-- .../Settings/PatchSettingLogoEndpoint.cs | 6 ++-- .../Settings/GetSettingByIdSpec.cs | 13 ------- 8 files changed, 10 insertions(+), 102 deletions(-) delete mode 100644 PyroFetes/Endpoints/Settings/CreateSettingEndpoint.cs delete mode 100644 PyroFetes/Endpoints/Settings/DeleteSettingEndpoint.cs delete mode 100644 PyroFetes/Specifications/Settings/GetSettingByIdSpec.cs diff --git a/PyroFetes/DTO/SettingDTO/Request/PatchSettingElectronicSignatureDto.cs b/PyroFetes/DTO/SettingDTO/Request/PatchSettingElectronicSignatureDto.cs index 2240628..fe2c421 100644 --- a/PyroFetes/DTO/SettingDTO/Request/PatchSettingElectronicSignatureDto.cs +++ b/PyroFetes/DTO/SettingDTO/Request/PatchSettingElectronicSignatureDto.cs @@ -2,6 +2,5 @@ namespace PyroFetes.DTO.SettingDTO.Request; public class PatchSettingElectronicSignatureDto { - public int Id { get; set; } public IFormFile? ElectronicSignature { get; set; } } \ No newline at end of file diff --git a/PyroFetes/DTO/SettingDTO/Request/PatchSettingLogoDto.cs b/PyroFetes/DTO/SettingDTO/Request/PatchSettingLogoDto.cs index 24963df..24f1b8e 100644 --- a/PyroFetes/DTO/SettingDTO/Request/PatchSettingLogoDto.cs +++ b/PyroFetes/DTO/SettingDTO/Request/PatchSettingLogoDto.cs @@ -2,6 +2,5 @@ namespace PyroFetes.DTO.SettingDTO.Request; public class PatchSettingLogoDto { - public int Id { get; set; } public IFormFile? Logo { get; set; } } \ No newline at end of file diff --git a/PyroFetes/Endpoints/Settings/CreateSettingEndpoint.cs b/PyroFetes/Endpoints/Settings/CreateSettingEndpoint.cs deleted file mode 100644 index dda0bd1..0000000 --- a/PyroFetes/Endpoints/Settings/CreateSettingEndpoint.cs +++ /dev/null @@ -1,35 +0,0 @@ -using FastEndpoints; -using PyroFetes.DTO.SettingDTO.Request; -using PyroFetes.Models; -using PyroFetes.Repositories; - -namespace PyroFetes.Endpoints.Settings; - -public class CreateSettingEndpoint(SettingsRepository settingsRepository) : Endpoint -{ - public override void Configure() - { - Post("/settings"); - AllowAnonymous(); - } - - public override async Task HandleAsync(CreateSettingDto req, CancellationToken ct) - { - // Encodage en base64 - using MemoryStream memoryStream = new(); - if (req.Logo != null) await req.Logo.CopyToAsync(memoryStream, ct); - byte[] logoBytes = memoryStream.ToArray(); - - if (req.ElectronicSignature != null) await req.ElectronicSignature.CopyToAsync(memoryStream, ct); - byte[] signatureBytes = memoryStream.ToArray(); - - Setting setting = new() - { - ElectronicSignature = Convert.ToBase64String(signatureBytes), - Logo = Convert.ToBase64String(logoBytes) - }; - - await settingsRepository.AddAsync(setting, ct); - await Send.NoContentAsync(ct); - } -} \ No newline at end of file diff --git a/PyroFetes/Endpoints/Settings/DeleteSettingEndpoint.cs b/PyroFetes/Endpoints/Settings/DeleteSettingEndpoint.cs deleted file mode 100644 index 319acf9..0000000 --- a/PyroFetes/Endpoints/Settings/DeleteSettingEndpoint.cs +++ /dev/null @@ -1,34 +0,0 @@ -using FastEndpoints; -using PyroFetes.Models; -using PyroFetes.Repositories; -using PyroFetes.Specifications.Settings; - -namespace PyroFetes.Endpoints.Settings; - -public class DeleteSettingRequest -{ - public int Id { get; set; } -} - -public class DeleteSettingEndpoint(SettingsRepository settingsRepository) : Endpoint -{ - public override void Configure() - { - Delete("/settings/{@Id}", x => new { x.Id }); - AllowAnonymous(); - } - - public override async Task HandleAsync(DeleteSettingRequest req, CancellationToken ct) - { - Setting? setting = await settingsRepository.SingleOrDefaultAsync(new GetSettingByIdSpec(req.Id), ct); - - if (setting is null) - { - await Send.NotFoundAsync(ct); - return; - } - - await settingsRepository.DeleteAsync(setting, ct); - await Send.NoContentAsync(ct); - } -} \ No newline at end of file diff --git a/PyroFetes/Endpoints/Settings/GetSettingEndpoint.cs b/PyroFetes/Endpoints/Settings/GetSettingEndpoint.cs index a36dcd9..e10ce01 100644 --- a/PyroFetes/Endpoints/Settings/GetSettingEndpoint.cs +++ b/PyroFetes/Endpoints/Settings/GetSettingEndpoint.cs @@ -2,28 +2,20 @@ using PyroFetes.DTO.SettingDTO.Response; using PyroFetes.Models; using PyroFetes.Repositories; -using PyroFetes.Specifications.Settings; namespace PyroFetes.Endpoints.Settings; -public class GetSettingRequest -{ - public int Id { get; set; } -} - -public class GetSettingEndpoint( - SettingsRepository settingsRepository, - AutoMapper.IMapper mapper) : Endpoint +public class GetSettingEndpoint(SettingsRepository settingsRepository, AutoMapper.IMapper mapper) : EndpointWithoutRequest { public override void Configure() { - Get("/settings/{@Id}", x => new { x.Id }); + Get("/settings/"); AllowAnonymous(); } - public override async Task HandleAsync(GetSettingRequest req, CancellationToken ct) + public override async Task HandleAsync(CancellationToken ct) { - Setting? setting = await settingsRepository.SingleOrDefaultAsync(new GetSettingByIdSpec(req.Id), ct); + Setting? setting = await settingsRepository.FirstOrDefaultAsync(ct); if (setting is null) { diff --git a/PyroFetes/Endpoints/Settings/PatchSettingElectronicSignatureEndpoint.cs b/PyroFetes/Endpoints/Settings/PatchSettingElectronicSignatureEndpoint.cs index 5588935..efd1808 100644 --- a/PyroFetes/Endpoints/Settings/PatchSettingElectronicSignatureEndpoint.cs +++ b/PyroFetes/Endpoints/Settings/PatchSettingElectronicSignatureEndpoint.cs @@ -2,7 +2,6 @@ using PyroFetes.DTO.SettingDTO.Request; using PyroFetes.Models; using PyroFetes.Repositories; -using PyroFetes.Specifications.Settings; namespace PyroFetes.Endpoints.Settings; @@ -10,13 +9,14 @@ public class PatchSettingElectronicSignatureEndpoint(SettingsRepository settings { public override void Configure() { - Patch("/settings/{@Id}/ElectronicSignature", x => new { x.Id }); + Patch("/settings/electronicSignature"); + AllowFormData(); AllowAnonymous(); } public override async Task HandleAsync(PatchSettingElectronicSignatureDto req, CancellationToken ct) { - Setting? setting = await settingsRepository.SingleOrDefaultAsync(new GetSettingByIdSpec(req.Id), ct); + Setting? setting = await settingsRepository.FirstOrDefaultAsync(ct); if (setting is null) { diff --git a/PyroFetes/Endpoints/Settings/PatchSettingLogoEndpoint.cs b/PyroFetes/Endpoints/Settings/PatchSettingLogoEndpoint.cs index 84de016..4047f19 100644 --- a/PyroFetes/Endpoints/Settings/PatchSettingLogoEndpoint.cs +++ b/PyroFetes/Endpoints/Settings/PatchSettingLogoEndpoint.cs @@ -2,7 +2,6 @@ using PyroFetes.DTO.SettingDTO.Request; using PyroFetes.Models; using PyroFetes.Repositories; -using PyroFetes.Specifications.Settings; namespace PyroFetes.Endpoints.Settings; @@ -10,13 +9,14 @@ public class PatchSettingLogoEndpoint(SettingsRepository settingsRepository) : E { public override void Configure() { - Patch("/settings/{@Id}/logo", x => new { x.Id }); + Patch("/settings/logo"); + AllowFormData(); AllowAnonymous(); } public override async Task HandleAsync(PatchSettingLogoDto req, CancellationToken ct) { - Setting? setting = await settingsRepository.SingleOrDefaultAsync(new GetSettingByIdSpec(req.Id), ct); + Setting? setting = await settingsRepository.FirstOrDefaultAsync(ct); if (setting is null) { diff --git a/PyroFetes/Specifications/Settings/GetSettingByIdSpec.cs b/PyroFetes/Specifications/Settings/GetSettingByIdSpec.cs deleted file mode 100644 index fb919a8..0000000 --- a/PyroFetes/Specifications/Settings/GetSettingByIdSpec.cs +++ /dev/null @@ -1,13 +0,0 @@ -using Ardalis.Specification; -using PyroFetes.Models; - -namespace PyroFetes.Specifications.Settings; - -public sealed class GetSettingByIdSpec : SingleResultSpecification -{ - public GetSettingByIdSpec(int settingId) - { - Query - .Where(setting => setting.Id == settingId); - } -} \ No newline at end of file From 48b9db6e1c0cb934b3e60c90d8e836c6d59ee63f Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Mon, 25 May 2026 16:21:58 +0100 Subject: [PATCH 31/51] Added SupplierId in DeliveryNote --- PyroFetes/Models/DeliveryNote.cs | 2 ++ PyroFetes/Models/Supplier.cs | 1 + 2 files changed, 3 insertions(+) diff --git a/PyroFetes/Models/DeliveryNote.cs b/PyroFetes/Models/DeliveryNote.cs index 9cf8e53..6497767 100644 --- a/PyroFetes/Models/DeliveryNote.cs +++ b/PyroFetes/Models/DeliveryNote.cs @@ -7,10 +7,12 @@ public class DeliveryNote [Key] public int Id { get; set; } [Required, MaxLength(100)] public string? TrackingNumber { get; set; } public int DelivererId { get; set; } + public int SupplierId { get; set; } [Required] public DateOnly EstimateDeliveryDate { get; set; } [Required] public DateOnly ExpeditionDate { get; set; } public DateOnly? RealDeliveryDate { get; set; } public Deliverer? Deliverer { get; set; } + public Supplier? Supplier { get; set; } public List? ProductDeliveries { get; set; } } \ No newline at end of file diff --git a/PyroFetes/Models/Supplier.cs b/PyroFetes/Models/Supplier.cs index 36b7247..0820812 100644 --- a/PyroFetes/Models/Supplier.cs +++ b/PyroFetes/Models/Supplier.cs @@ -15,5 +15,6 @@ public class Supplier public List? Prices { get; set; } public List? Quotations { get; set; } + public List? DeliveryNotes { get; set; } public List? PurchaseOrders { get; set; } } \ No newline at end of file From 3cb619cfa696bc08cdd053421d5ddb0f268465eb Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Mon, 25 May 2026 16:38:33 +0100 Subject: [PATCH 32/51] Fixed error of display with price of product in all documents --- .../Request/CreateDeliveryNoteDto.cs | 1 + .../Response/GetPurchaseOrderDto.cs | 1 + .../CreateDeliveryNoteEndpoint.cs | 7 +- ...FieldForSupplierInDeliveryNote.Designer.cs | 2015 +++++++++++++++++ ...edMissingFieldForSupplierInDeliveryNote.cs | 50 + .../PyroFetesDbContextModelSnapshot.cs | 15 + .../Services/Pdf/DeliveryNotePdfService.cs | 20 +- .../Services/Pdf/PurchaseOrderPdfService.cs | 13 +- PyroFetes/Services/Pdf/QuotationPdfService.cs | 20 +- .../GetDeliveryNoteByIdWithProductsSpec.cs | 7 +- .../GetPurchaseOrderByIdWithProductsSpec.cs | 3 +- .../GetQuotationByIdWithProductsSpec.cs | 3 +- 12 files changed, 2128 insertions(+), 27 deletions(-) create mode 100644 PyroFetes/Migrations/20260525152029_AddedMissingFieldForSupplierInDeliveryNote.Designer.cs create mode 100644 PyroFetes/Migrations/20260525152029_AddedMissingFieldForSupplierInDeliveryNote.cs diff --git a/PyroFetes/DTO/DeliveryNote/Request/CreateDeliveryNoteDto.cs b/PyroFetes/DTO/DeliveryNote/Request/CreateDeliveryNoteDto.cs index b486e16..42c4bb3 100644 --- a/PyroFetes/DTO/DeliveryNote/Request/CreateDeliveryNoteDto.cs +++ b/PyroFetes/DTO/DeliveryNote/Request/CreateDeliveryNoteDto.cs @@ -7,6 +7,7 @@ public class CreateDeliveryNoteDto public DateOnly ExpeditionDate { get; set; } public int DelivererId { get; set; } + public int SupplierId { get; set; } public Dictionary? ProductQuantities { get; set; } } \ No newline at end of file diff --git a/PyroFetes/DTO/PurchaseOrder/Response/GetPurchaseOrderDto.cs b/PyroFetes/DTO/PurchaseOrder/Response/GetPurchaseOrderDto.cs index f498c64..282ff85 100644 --- a/PyroFetes/DTO/PurchaseOrder/Response/GetPurchaseOrderDto.cs +++ b/PyroFetes/DTO/PurchaseOrder/Response/GetPurchaseOrderDto.cs @@ -6,6 +6,7 @@ public class GetPurchaseOrderDto { public int Id { get; set; } public string? PurchaseConditions { get; set; } + public int SupplierId { get; set; } public string? SupplierName { get; set; } public List? Products { get; set; } } \ No newline at end of file diff --git a/PyroFetes/Endpoints/DeliveryNotes/CreateDeliveryNoteEndpoint.cs b/PyroFetes/Endpoints/DeliveryNotes/CreateDeliveryNoteEndpoint.cs index 2e62227..4781faa 100644 --- a/PyroFetes/Endpoints/DeliveryNotes/CreateDeliveryNoteEndpoint.cs +++ b/PyroFetes/Endpoints/DeliveryNotes/CreateDeliveryNoteEndpoint.cs @@ -4,6 +4,7 @@ using PyroFetes.Models; using PyroFetes.Repositories; using PyroFetes.Specifications.Deliverers; using PyroFetes.Specifications.Products; +using PyroFetes.Specifications.Suppliers; namespace PyroFetes.Endpoints.DeliveryNotes; @@ -11,6 +12,7 @@ public class CreateDeliveryNoteEndpoint( DeliveryNotesRepository deliveryNotesRepository, DeliverersRepository deliverersRepository, ProductsRepository productsRepository, + SuppliersRepository suppliersRepository, ProductDeliveriesRepository productDeliveriesRepository) : Endpoint { public override void Configure() @@ -22,7 +24,8 @@ public class CreateDeliveryNoteEndpoint( public override async Task HandleAsync(CreateDeliveryNoteDto req, CancellationToken ct) { Deliverer? deliverer = await deliverersRepository.SingleOrDefaultAsync(new GetDelivererByIdSpec(req.DelivererId), ct); - if (deliverer is null) + Supplier? supplier = await suppliersRepository.SingleOrDefaultAsync(new GetSupplierByIdSpec(req.SupplierId), ct); + if (deliverer is null || supplier is null) { await Send.NotFoundAsync(ct); return; @@ -36,6 +39,8 @@ public class CreateDeliveryNoteEndpoint( ExpeditionDate = req.ExpeditionDate, DelivererId = deliverer.Id, Deliverer = deliverer, + SupplierId = req.SupplierId, + Supplier = supplier }; await deliveryNotesRepository.AddAsync(newDeliveryNote, ct); diff --git a/PyroFetes/Migrations/20260525152029_AddedMissingFieldForSupplierInDeliveryNote.Designer.cs b/PyroFetes/Migrations/20260525152029_AddedMissingFieldForSupplierInDeliveryNote.Designer.cs new file mode 100644 index 0000000..5dfebd7 --- /dev/null +++ b/PyroFetes/Migrations/20260525152029_AddedMissingFieldForSupplierInDeliveryNote.Designer.cs @@ -0,0 +1,2015 @@ +// +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("20260525152029_AddedMissingFieldForSupplierInDeliveryNote")] + partial class AddedMissingFieldForSupplierInDeliveryNote + { + /// + 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("SupplierId") + .HasColumnType("int"); + + b.Property("TrackingNumber") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.HasKey("Id"); + + b.HasIndex("DelivererId"); + + b.HasIndex("SupplierId"); + + 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.Property("SupplierId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("SupplierId"); + + 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.Property("SupplierId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("CustomerId"); + + b.HasIndex("SupplierId"); + + 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.HasOne("PyroFetes.Models.Supplier", "Supplier") + .WithMany("DeliveryNotes") + .HasForeignKey("SupplierId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Deliverer"); + + b.Navigation("Supplier"); + }); + + 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.PurchaseOrder", b => + { + b.HasOne("PyroFetes.Models.Supplier", "Supplier") + .WithMany("PurchaseOrders") + .HasForeignKey("SupplierId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Supplier"); + }); + + 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.HasOne("PyroFetes.Models.Supplier", "Supplier") + .WithMany("Quotations") + .HasForeignKey("SupplierId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Customer"); + + b.Navigation("Supplier"); + }); + + 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("DeliveryNotes"); + + b.Navigation("Prices"); + + b.Navigation("PurchaseOrders"); + + b.Navigation("Quotations"); + }); + + 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/20260525152029_AddedMissingFieldForSupplierInDeliveryNote.cs b/PyroFetes/Migrations/20260525152029_AddedMissingFieldForSupplierInDeliveryNote.cs new file mode 100644 index 0000000..d278e36 --- /dev/null +++ b/PyroFetes/Migrations/20260525152029_AddedMissingFieldForSupplierInDeliveryNote.cs @@ -0,0 +1,50 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace PyroFetes.Migrations +{ + /// + public partial class AddedMissingFieldForSupplierInDeliveryNote : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "SupplierId", + table: "DeliveryNotes", + type: "int", + nullable: false, + defaultValue: 0); + + migrationBuilder.CreateIndex( + name: "IX_DeliveryNotes_SupplierId", + table: "DeliveryNotes", + column: "SupplierId"); + + migrationBuilder.AddForeignKey( + name: "FK_DeliveryNotes_Suppliers_SupplierId", + table: "DeliveryNotes", + column: "SupplierId", + principalTable: "Suppliers", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropForeignKey( + name: "FK_DeliveryNotes_Suppliers_SupplierId", + table: "DeliveryNotes"); + + migrationBuilder.DropIndex( + name: "IX_DeliveryNotes_SupplierId", + table: "DeliveryNotes"); + + migrationBuilder.DropColumn( + name: "SupplierId", + table: "DeliveryNotes"); + } + } +} diff --git a/PyroFetes/Migrations/PyroFetesDbContextModelSnapshot.cs b/PyroFetes/Migrations/PyroFetesDbContextModelSnapshot.cs index d0b5a2c..53f3b23 100644 --- a/PyroFetes/Migrations/PyroFetesDbContextModelSnapshot.cs +++ b/PyroFetes/Migrations/PyroFetesDbContextModelSnapshot.cs @@ -329,6 +329,9 @@ namespace PyroFetes.Migrations b.Property("RealDeliveryDate") .HasColumnType("date"); + b.Property("SupplierId") + .HasColumnType("int"); + b.Property("TrackingNumber") .IsRequired() .HasMaxLength(100) @@ -338,6 +341,8 @@ namespace PyroFetes.Migrations b.HasIndex("DelivererId"); + b.HasIndex("SupplierId"); + b.ToTable("DeliveryNotes"); }); @@ -1353,7 +1358,15 @@ namespace PyroFetes.Migrations .OnDelete(DeleteBehavior.Cascade) .IsRequired(); + b.HasOne("PyroFetes.Models.Supplier", "Supplier") + .WithMany("DeliveryNotes") + .HasForeignKey("SupplierId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + b.Navigation("Deliverer"); + + b.Navigation("Supplier"); }); modelBuilder.Entity("PyroFetes.Models.ExperienceLevel", b => @@ -1969,6 +1982,8 @@ namespace PyroFetes.Migrations modelBuilder.Entity("PyroFetes.Models.Supplier", b => { + b.Navigation("DeliveryNotes"); + b.Navigation("Prices"); b.Navigation("PurchaseOrders"); diff --git a/PyroFetes/Services/Pdf/DeliveryNotePdfService.cs b/PyroFetes/Services/Pdf/DeliveryNotePdfService.cs index 8435455..9c20eff 100644 --- a/PyroFetes/Services/Pdf/DeliveryNotePdfService.cs +++ b/PyroFetes/Services/Pdf/DeliveryNotePdfService.cs @@ -16,7 +16,7 @@ public class DeliveryNotePdfService : IDeliveryNotePdfService { byte[] logo = Convert.FromBase64String(setting.Logo!); byte[] signature = Convert.FromBase64String(setting.ElectronicSignature!); - int total = 0; + decimal total = 0; int totalQuantity = 0; Document document = Document.Create(container => { @@ -42,7 +42,7 @@ public class DeliveryNotePdfService : IDeliveryNotePdfService col.Item().Height(5); col.Item().AlignLeft().Text($"Estimée au {deliveryNote.EstimateDeliveryDate}"); col.Item().Height(5); - col.Item().AlignLeft().Text($"Reçu le {deliveryNote.RealDeliveryDate}"); + col.Item().AlignLeft().Text(deliveryNote.RealDeliveryDate is null ? "Pas encore arrivée à destination" : $"Reçu le {deliveryNote.RealDeliveryDate}"); }); // Logo + société à droite @@ -95,13 +95,17 @@ public class DeliveryNotePdfService : IDeliveryNotePdfService foreach (ProductDelivery l in lignes) { + decimal price = l.Product!.Prices! + .FirstOrDefault(x => x.SupplierId == l.DeliveryNote!.SupplierId && x.ProductId == l.ProductId) + ?.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) => @@ -114,10 +118,10 @@ public class DeliveryNotePdfService : IDeliveryNotePdfService col.Item().LineHorizontal(1); col.Item().Height(30); - col.Item().AlignRight().Text($"Total: {totalQuantity:n2} produits"); + col.Item().AlignRight().Text($"Total: {totalQuantity} produits"); col.Item().AlignRight().Text($"Total HT: {total:n2} €"); col.Item().AlignRight().Text("Taxe : 20 %"); - col.Item().AlignRight().Text($"Total TTC: {(total * 1.2):n2} €"); + col.Item().AlignRight().Text($"Total TTC: {total * (decimal)1.2:n2} €"); }); // Signature en bas à droite diff --git a/PyroFetes/Services/Pdf/PurchaseOrderPdfService.cs b/PyroFetes/Services/Pdf/PurchaseOrderPdfService.cs index 6fe2e7a..56ef881 100644 --- a/PyroFetes/Services/Pdf/PurchaseOrderPdfService.cs +++ b/PyroFetes/Services/Pdf/PurchaseOrderPdfService.cs @@ -35,8 +35,11 @@ public class PurchaseOrderPdfService : IPurchaseOrderPdfService col.Item().Text(""); col.Item().Text(""); col.Item().Text(""); - col.Item().Text("Fournisseur").SemiBold().FontSize(12); - col.Item().Text("Mettre fournisseur ici"); + col.Item().Text("Fournisseur :").SemiBold().FontSize(12); + col.Item().Text($"{purchaseOrder.Supplier?.Name}"); + col.Item().Text($"{purchaseOrder.Supplier?.Address}"); + col.Item().Text($"{purchaseOrder.Supplier?.ZipCode} {purchaseOrder.Supplier?.City}"); + col.Item().Text($"{purchaseOrder.Supplier?.DeliveryDelay} jours de délai moyen de livraison"); }); // Logo + société à droite @@ -93,7 +96,7 @@ public class PurchaseOrderPdfService : IPurchaseOrderPdfService foreach (PurchaseProduct l in lignes) { decimal price = l.Product!.Prices! - .FirstOrDefault(p => p.SupplierId == l.PurchaseOrder!.SupplierId) + .FirstOrDefault(x => x.SupplierId == l.PurchaseOrder!.SupplierId && x.ProductId == l.ProductId) ?.SellingPrice ?? 0; table.Cell().Element(CellBody).Text(l.Product?.Name); @@ -129,10 +132,10 @@ public class PurchaseOrderPdfService : IPurchaseOrderPdfService // Colonne droite : totaux row.ConstantItem(180).Column(right => { - right.Item().AlignRight().Text($"Total: {totalQuantity:n2} produits"); + right.Item().AlignRight().Text($"Total: {totalQuantity} 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 * (decimal)1.2:n2} €"); }); }); }); diff --git a/PyroFetes/Services/Pdf/QuotationPdfService.cs b/PyroFetes/Services/Pdf/QuotationPdfService.cs index 8bc5557..87204e7 100644 --- a/PyroFetes/Services/Pdf/QuotationPdfService.cs +++ b/PyroFetes/Services/Pdf/QuotationPdfService.cs @@ -16,7 +16,7 @@ public class QuotationPdfService : IQuotationPdfService { byte[] logo = Convert.FromBase64String(setting.Logo!); byte[] signature = Convert.FromBase64String(setting.ElectronicSignature!); - int total = 0; + decimal total = 0; Document document = Document.Create(container => { container.Page(page => @@ -91,19 +91,21 @@ public class QuotationPdfService : IQuotationPdfService foreach (QuotationProduct l in lignes) { + decimal price = l.Product!.Prices! + .FirstOrDefault(x => x.SupplierId == l.Quotation!.SupplierId && x.ProductId == l.ProductId) + ?.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($"{price * l.Quantity:n2} €"); - total = total + l.Quantity * l.Quantity; + total += l.Quantity * price; } - IContainer CellHeader(IContainer c) => - c.BorderBottom(1).PaddingVertical(5).DefaultTextStyle(x => x.SemiBold()); + IContainer CellHeader(IContainer c) => c.BorderBottom(1).PaddingVertical(5).DefaultTextStyle(x => x.SemiBold()); - IContainer CellBody(IContainer c) => - c.PaddingVertical(2); + IContainer CellBody(IContainer c) => c.PaddingVertical(2); }); col.Item().LineHorizontal(1); @@ -125,7 +127,7 @@ public class QuotationPdfService : IQuotationPdfService { 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 * (decimal)1.2:n2} €"); }); }); }); diff --git a/PyroFetes/Specifications/DeliveryNotes/GetDeliveryNoteByIdWithProductsSpec.cs b/PyroFetes/Specifications/DeliveryNotes/GetDeliveryNoteByIdWithProductsSpec.cs index 0eb3506..3ba5fbd 100644 --- a/PyroFetes/Specifications/DeliveryNotes/GetDeliveryNoteByIdWithProductsSpec.cs +++ b/PyroFetes/Specifications/DeliveryNotes/GetDeliveryNoteByIdWithProductsSpec.cs @@ -8,8 +8,11 @@ public class GetDeliveryNoteByIdWithProductsSpec : SingleResultSpecification x.Id == deliveryNoteId) .Include(x => x.ProductDeliveries!) - .ThenInclude(p => p.Product); + .ThenInclude(p => p.Product) + .ThenInclude(x => x!.Prices) + .Include(x => x.Deliverer) + .Include(x => x.Supplier) + .Where(x => x.Id == deliveryNoteId); } } \ No newline at end of file diff --git a/PyroFetes/Specifications/PurchaseOrders/GetPurchaseOrderByIdWithProductsSpec.cs b/PyroFetes/Specifications/PurchaseOrders/GetPurchaseOrderByIdWithProductsSpec.cs index 8158a7f..fbd3c38 100644 --- a/PyroFetes/Specifications/PurchaseOrders/GetPurchaseOrderByIdWithProductsSpec.cs +++ b/PyroFetes/Specifications/PurchaseOrders/GetPurchaseOrderByIdWithProductsSpec.cs @@ -11,6 +11,7 @@ public class GetPurchaseOrderByIdWithProductsSpec : SingleResultSpecification x.Id == purchaseOrderId) .Include(x => x.PurchaseProducts!) .ThenInclude(p => p.Product) - .ThenInclude(p => p!.Prices); + .ThenInclude(p => p!.Prices) + .Include(x => x.Supplier); } } \ No newline at end of file diff --git a/PyroFetes/Specifications/Quotations/GetQuotationByIdWithProductsSpec.cs b/PyroFetes/Specifications/Quotations/GetQuotationByIdWithProductsSpec.cs index 93d7472..b7f0e88 100644 --- a/PyroFetes/Specifications/Quotations/GetQuotationByIdWithProductsSpec.cs +++ b/PyroFetes/Specifications/Quotations/GetQuotationByIdWithProductsSpec.cs @@ -10,6 +10,7 @@ public class GetQuotationByIdWithProductsSpec : SingleResultSpecification x.Id == quotationId) .Include(x => x.QuotationProducts!) - .ThenInclude(p => p.Product); + .ThenInclude(x => x.Product) + .ThenInclude(x => x!.Prices); } } \ No newline at end of file From 57646a141740ea3a9b90a32988204e234114b463 Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Tue, 26 May 2026 10:25:05 +0100 Subject: [PATCH 33/51] Fix error with spec of product under limit --- .../Specifications/Products/GetProductsUnderLimitSpec.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PyroFetes/Specifications/Products/GetProductsUnderLimitSpec.cs b/PyroFetes/Specifications/Products/GetProductsUnderLimitSpec.cs index 23075f7..5b3c1f4 100644 --- a/PyroFetes/Specifications/Products/GetProductsUnderLimitSpec.cs +++ b/PyroFetes/Specifications/Products/GetProductsUnderLimitSpec.cs @@ -8,7 +8,7 @@ public sealed class GetProductsUnderLimitSpec : Specification public GetProductsUnderLimitSpec() { Query - .Include(p => p.QuotationProducts) - .Where(p => p.QuotationProducts != null && p.QuotationProducts.Any(q => q.Quantity < p.MinimalQuantity)); + .Include(x => x.WarehouseProducts) + .Where(x => x.WarehouseProducts != null && x.WarehouseProducts.Sum(p => p.Quantity) < x.MinimalQuantity); } } \ No newline at end of file From b13b8ebfb6efa0cb19c9ccdb96caebec7ca0c869 Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Tue, 26 May 2026 10:53:10 +0100 Subject: [PATCH 34/51] Added new endpoint to manage deliveries --- .../GetAllDeliveryNotesNotArrivedEndpoint.cs | 20 +++++++++++++++++++ .../DeliveryNotes/GetAllDeliveryNoteSpec.cs | 3 ++- .../GetAllDeliveryNotesByRealDateSpec.cs | 17 ++++++++++++++++ 3 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 PyroFetes/Endpoints/DeliveryNotes/GetAllDeliveryNotesNotArrivedEndpoint.cs create mode 100644 PyroFetes/Specifications/DeliveryNotes/GetAllDeliveryNotesByRealDateSpec.cs diff --git a/PyroFetes/Endpoints/DeliveryNotes/GetAllDeliveryNotesNotArrivedEndpoint.cs b/PyroFetes/Endpoints/DeliveryNotes/GetAllDeliveryNotesNotArrivedEndpoint.cs new file mode 100644 index 0000000..07cdaeb --- /dev/null +++ b/PyroFetes/Endpoints/DeliveryNotes/GetAllDeliveryNotesNotArrivedEndpoint.cs @@ -0,0 +1,20 @@ +using FastEndpoints; +using PyroFetes.DTO.DeliveryNote.Response; +using PyroFetes.Repositories; +using PyroFetes.Specifications.DeliveryNotes; + +namespace PyroFetes.Endpoints.DeliveryNotes; + +public class GetAllDeliveryNotesNotArrivedEndpoint(DeliveryNotesRepository deliveryNotesRepository) : EndpointWithoutRequest> +{ + public override void Configure() + { + Get("/deliveryNotes/validation"); + AllowAnonymous(); + } + + public override async Task HandleAsync(CancellationToken ct) + { + await Send.OkAsync(await deliveryNotesRepository.ProjectToListAsync(new GetAllDeliveryNotesByRealDateSpec(), ct), ct); + } +} \ No newline at end of file diff --git a/PyroFetes/Specifications/DeliveryNotes/GetAllDeliveryNoteSpec.cs b/PyroFetes/Specifications/DeliveryNotes/GetAllDeliveryNoteSpec.cs index 30ef09a..fb67cf6 100644 --- a/PyroFetes/Specifications/DeliveryNotes/GetAllDeliveryNoteSpec.cs +++ b/PyroFetes/Specifications/DeliveryNotes/GetAllDeliveryNoteSpec.cs @@ -11,6 +11,7 @@ public class GetAllDeliveryNoteSpec : Specification .Include(x => x.Deliverer) .Include(x => x.ProductDeliveries)! .ThenInclude(x => x.Product) - .Where(x => true); + .Where(x => true) + .OrderByDescending(x => x.ExpeditionDate); } } \ No newline at end of file diff --git a/PyroFetes/Specifications/DeliveryNotes/GetAllDeliveryNotesByRealDateSpec.cs b/PyroFetes/Specifications/DeliveryNotes/GetAllDeliveryNotesByRealDateSpec.cs new file mode 100644 index 0000000..041842f --- /dev/null +++ b/PyroFetes/Specifications/DeliveryNotes/GetAllDeliveryNotesByRealDateSpec.cs @@ -0,0 +1,17 @@ +using Ardalis.Specification; +using PyroFetes.Models; + +namespace PyroFetes.Specifications.DeliveryNotes; + +public class GetAllDeliveryNotesByRealDateSpec : Specification +{ + public GetAllDeliveryNotesByRealDateSpec() + { + Query + .Include(x => x.Deliverer) + .Include(x => x.ProductDeliveries)! + .ThenInclude(x => x.Product) + .Where(x => x.RealDeliveryDate == null) + .OrderByDescending(x => x.RealDeliveryDate); + } +} \ No newline at end of file From ed59efe4f82524ca5c30e861ea0f3c6297e12433 Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Tue, 26 May 2026 11:16:16 +0100 Subject: [PATCH 35/51] Added new endpoint to manage warehouse --- .../DTO/WareHouse/Response/GetWareHouseDto.cs | 7 +++++++ .../Endpoints/GetAllWarehouseEndpoint.cs | 19 +++++++++++++++++++ .../PatchWareHouseProductQuantityEndpoint.cs | 18 ++++++++++++------ PyroFetes/Program.cs | 1 + PyroFetes/Repositories/WareHouseRepository.cs | 5 +++++ .../WareHouse/GetWareHouseByIdSpec.cs | 13 +++++++++++++ 6 files changed, 57 insertions(+), 6 deletions(-) create mode 100644 PyroFetes/DTO/WareHouse/Response/GetWareHouseDto.cs create mode 100644 PyroFetes/Endpoints/GetAllWarehouseEndpoint.cs create mode 100644 PyroFetes/Repositories/WareHouseRepository.cs create mode 100644 PyroFetes/Specifications/WareHouse/GetWareHouseByIdSpec.cs diff --git a/PyroFetes/DTO/WareHouse/Response/GetWareHouseDto.cs b/PyroFetes/DTO/WareHouse/Response/GetWareHouseDto.cs new file mode 100644 index 0000000..7b820dc --- /dev/null +++ b/PyroFetes/DTO/WareHouse/Response/GetWareHouseDto.cs @@ -0,0 +1,7 @@ +namespace PyroFetes.DTO.WareHouse.Response; + +public class GetWareHouseDto +{ + public int Id { get; set; } + public string? Name { get; set; } +} \ No newline at end of file diff --git a/PyroFetes/Endpoints/GetAllWarehouseEndpoint.cs b/PyroFetes/Endpoints/GetAllWarehouseEndpoint.cs new file mode 100644 index 0000000..ac2c7a2 --- /dev/null +++ b/PyroFetes/Endpoints/GetAllWarehouseEndpoint.cs @@ -0,0 +1,19 @@ +using FastEndpoints; +using PyroFetes.DTO.WareHouse.Response; +using PyroFetes.Repositories; + +namespace PyroFetes.Endpoints; + +public class GetAllWarehouseEndpoint(WareHouseRepository wareHouseRepository, AutoMapper.IMapper mapper) : EndpointWithoutRequest> +{ + public override void Configure() + { + Get("/wareHouses/"); + AllowAnonymous(); + } + + public override async Task HandleAsync(CancellationToken ct) + { + await Send.OkAsync(await wareHouseRepository.ProjectToListAsync(ct), ct); + } +} \ No newline at end of file diff --git a/PyroFetes/Endpoints/WareHouseProducts/PatchWareHouseProductQuantityEndpoint.cs b/PyroFetes/Endpoints/WareHouseProducts/PatchWareHouseProductQuantityEndpoint.cs index e346e9b..2c43f8d 100644 --- a/PyroFetes/Endpoints/WareHouseProducts/PatchWareHouseProductQuantityEndpoint.cs +++ b/PyroFetes/Endpoints/WareHouseProducts/PatchWareHouseProductQuantityEndpoint.cs @@ -3,11 +3,12 @@ using PyroFetes.DTO.WareHouseProduct.Request; using PyroFetes.DTO.WareHouseProduct.Response; using PyroFetes.Models; using PyroFetes.Repositories; +using PyroFetes.Specifications.WareHouse; using PyroFetes.Specifications.WarehouseProducts; namespace PyroFetes.Endpoints.WareHouseProducts; -public class PatchWareHouseProductQuantityEndpoint(WarehouseProductsRepository warehouseProductsRepository) : Endpoint +public class PatchWareHouseProductQuantityEndpoint(WarehouseProductsRepository warehouseProductsRepository, WareHouseRepository wareHouseRepository , AutoMapper.IMapper mapper) : Endpoint { public override void Configure() { @@ -18,16 +19,21 @@ public class PatchWareHouseProductQuantityEndpoint(WarehouseProductsRepository w public override async Task HandleAsync(PatchWareHouseProductQuantityDto req, CancellationToken ct) { WarehouseProduct? wareHouseProduct = await warehouseProductsRepository.FirstOrDefaultAsync(new GetWarehouseProductByProductIdSpec(req.ProductId, req.WareHouseId), ct); + Warehouse? warehouse = await wareHouseRepository.SingleOrDefaultAsync(new GetWareHouseByIdSpec(req.WareHouseId), ct); - if (wareHouseProduct is null) + if (warehouse is null) { await Send.NotFoundAsync(ct); return; } - - wareHouseProduct.Quantity = req.Quantity; - await warehouseProductsRepository.SaveChangesAsync(ct); - + + if (wareHouseProduct is null) await warehouseProductsRepository.AddAsync(mapper.Map(req), ct); + else + { + wareHouseProduct.Quantity = req.Quantity; + await warehouseProductsRepository.SaveChangesAsync(ct); + } + await Send.NoContentAsync(ct); } } \ No newline at end of file diff --git a/PyroFetes/Program.cs b/PyroFetes/Program.cs index ac75892..bf236f3 100644 --- a/PyroFetes/Program.cs +++ b/PyroFetes/Program.cs @@ -49,6 +49,7 @@ builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); +builder.Services.AddScoped(); // Ajout des services builder.Services.AddScoped(); diff --git a/PyroFetes/Repositories/WareHouseRepository.cs b/PyroFetes/Repositories/WareHouseRepository.cs new file mode 100644 index 0000000..c393c28 --- /dev/null +++ b/PyroFetes/Repositories/WareHouseRepository.cs @@ -0,0 +1,5 @@ +using PyroFetes.Models; + +namespace PyroFetes.Repositories; + +public class WareHouseRepository(PyroFetesDbContext pyrofetesContext, AutoMapper.IMapper mapper) : PyrofetesRepository(pyrofetesContext, mapper); \ No newline at end of file diff --git a/PyroFetes/Specifications/WareHouse/GetWareHouseByIdSpec.cs b/PyroFetes/Specifications/WareHouse/GetWareHouseByIdSpec.cs new file mode 100644 index 0000000..edf79c7 --- /dev/null +++ b/PyroFetes/Specifications/WareHouse/GetWareHouseByIdSpec.cs @@ -0,0 +1,13 @@ +using Ardalis.Specification; +using PyroFetes.Models; + +namespace PyroFetes.Specifications.WareHouse; + +public class GetWareHouseByIdSpec : SingleResultSpecification +{ + public GetWareHouseByIdSpec(int id) + { + Query + .Where(x => x.Id == id); + } +} \ No newline at end of file From aa40ae2e7ae5724396b52d4093883a5f78b25751 Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Tue, 26 May 2026 11:43:41 +0100 Subject: [PATCH 36/51] Added missing mappings profiles --- PyroFetes/MappingProfiles/DtoToEntityMappings.cs | 4 +--- PyroFetes/MappingProfiles/EntityToDtoMappings.cs | 3 +++ 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/PyroFetes/MappingProfiles/DtoToEntityMappings.cs b/PyroFetes/MappingProfiles/DtoToEntityMappings.cs index 5b7d8b7..689f5ae 100644 --- a/PyroFetes/MappingProfiles/DtoToEntityMappings.cs +++ b/PyroFetes/MappingProfiles/DtoToEntityMappings.cs @@ -81,8 +81,6 @@ public class DtoToEntityMappings : Profile CreateMap() .ForMember(dest => dest.Id, opt => opt.Ignore()); - CreateMap() - .ForMember(dest => dest.ProductId, opt => opt.Ignore()) - .ForMember(dest => dest.WarehouseId, opt => opt.Ignore()); + CreateMap(); } } \ No newline at end of file diff --git a/PyroFetes/MappingProfiles/EntityToDtoMappings.cs b/PyroFetes/MappingProfiles/EntityToDtoMappings.cs index 0e10014..6e4c985 100644 --- a/PyroFetes/MappingProfiles/EntityToDtoMappings.cs +++ b/PyroFetes/MappingProfiles/EntityToDtoMappings.cs @@ -11,6 +11,7 @@ using PyroFetes.DTO.QuotationProduct.Response; using PyroFetes.DTO.SettingDTO.Response; using PyroFetes.DTO.Supplier.Response; using PyroFetes.DTO.User.Response; +using PyroFetes.DTO.WareHouse.Response; using PyroFetes.DTO.WareHouseProduct.Response; using PyroFetes.Models; @@ -56,5 +57,7 @@ public class EntityToDtoMappings : Profile CreateMap(); CreateMap(); + + CreateMap(); } } \ No newline at end of file From fdaead91ff5a0ccd71b93f1afa109be96f7e4fbc Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Tue, 26 May 2026 12:01:09 +0100 Subject: [PATCH 37/51] Changed display of delivery note --- .../Specifications/DeliveryNotes/GetAllDeliveryNoteSpec.cs | 4 ++-- .../DeliveryNotes/GetAllDeliveryNotesByRealDateSpec.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/PyroFetes/Specifications/DeliveryNotes/GetAllDeliveryNoteSpec.cs b/PyroFetes/Specifications/DeliveryNotes/GetAllDeliveryNoteSpec.cs index fb67cf6..83b85ec 100644 --- a/PyroFetes/Specifications/DeliveryNotes/GetAllDeliveryNoteSpec.cs +++ b/PyroFetes/Specifications/DeliveryNotes/GetAllDeliveryNoteSpec.cs @@ -11,7 +11,7 @@ public class GetAllDeliveryNoteSpec : Specification .Include(x => x.Deliverer) .Include(x => x.ProductDeliveries)! .ThenInclude(x => x.Product) - .Where(x => true) - .OrderByDescending(x => x.ExpeditionDate); + .OrderBy(x => x.RealDeliveryDate) + .ThenByDescending(x => x.ExpeditionDate); } } \ No newline at end of file diff --git a/PyroFetes/Specifications/DeliveryNotes/GetAllDeliveryNotesByRealDateSpec.cs b/PyroFetes/Specifications/DeliveryNotes/GetAllDeliveryNotesByRealDateSpec.cs index 041842f..46feb4c 100644 --- a/PyroFetes/Specifications/DeliveryNotes/GetAllDeliveryNotesByRealDateSpec.cs +++ b/PyroFetes/Specifications/DeliveryNotes/GetAllDeliveryNotesByRealDateSpec.cs @@ -12,6 +12,6 @@ public class GetAllDeliveryNotesByRealDateSpec : Specification .Include(x => x.ProductDeliveries)! .ThenInclude(x => x.Product) .Where(x => x.RealDeliveryDate == null) - .OrderByDescending(x => x.RealDeliveryDate); + .OrderByDescending(x => x.ExpeditionDate); } } \ No newline at end of file From 19c63ef317fa985f41558ba048c7b284f5b6ebb3 Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Tue, 26 May 2026 12:06:15 +0100 Subject: [PATCH 38/51] Fixed error with update of quantity in stock page --- PyroFetes/Endpoints/{ => WareHouse}/GetAllWarehouseEndpoint.cs | 2 +- .../WareHouseProducts/PatchWareHouseProductQuantityEndpoint.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename PyroFetes/Endpoints/{ => WareHouse}/GetAllWarehouseEndpoint.cs (92%) diff --git a/PyroFetes/Endpoints/GetAllWarehouseEndpoint.cs b/PyroFetes/Endpoints/WareHouse/GetAllWarehouseEndpoint.cs similarity index 92% rename from PyroFetes/Endpoints/GetAllWarehouseEndpoint.cs rename to PyroFetes/Endpoints/WareHouse/GetAllWarehouseEndpoint.cs index ac2c7a2..50bf272 100644 --- a/PyroFetes/Endpoints/GetAllWarehouseEndpoint.cs +++ b/PyroFetes/Endpoints/WareHouse/GetAllWarehouseEndpoint.cs @@ -2,7 +2,7 @@ using PyroFetes.DTO.WareHouse.Response; using PyroFetes.Repositories; -namespace PyroFetes.Endpoints; +namespace PyroFetes.Endpoints.WareHouse; public class GetAllWarehouseEndpoint(WareHouseRepository wareHouseRepository, AutoMapper.IMapper mapper) : EndpointWithoutRequest> { diff --git a/PyroFetes/Endpoints/WareHouseProducts/PatchWareHouseProductQuantityEndpoint.cs b/PyroFetes/Endpoints/WareHouseProducts/PatchWareHouseProductQuantityEndpoint.cs index 2c43f8d..9e6733f 100644 --- a/PyroFetes/Endpoints/WareHouseProducts/PatchWareHouseProductQuantityEndpoint.cs +++ b/PyroFetes/Endpoints/WareHouseProducts/PatchWareHouseProductQuantityEndpoint.cs @@ -30,7 +30,7 @@ public class PatchWareHouseProductQuantityEndpoint(WarehouseProductsRepository w if (wareHouseProduct is null) await warehouseProductsRepository.AddAsync(mapper.Map(req), ct); else { - wareHouseProduct.Quantity = req.Quantity; + wareHouseProduct.Quantity += req.Quantity; await warehouseProductsRepository.SaveChangesAsync(ct); } From 897b036fc58cc5b9d8875e5ed3a361e5bfe30418 Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Tue, 26 May 2026 18:55:54 +0100 Subject: [PATCH 39/51] fix error --- PyroFetes/Endpoints/PurchaseOrders/CreatePurchaseOrder.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/PyroFetes/Endpoints/PurchaseOrders/CreatePurchaseOrder.cs b/PyroFetes/Endpoints/PurchaseOrders/CreatePurchaseOrder.cs index 6428158..977c914 100644 --- a/PyroFetes/Endpoints/PurchaseOrders/CreatePurchaseOrder.cs +++ b/PyroFetes/Endpoints/PurchaseOrders/CreatePurchaseOrder.cs @@ -42,6 +42,7 @@ public class CreatePurchaseOrder( if (purchaseProduct is not null) { await Send.StringAsync("Le produit est déjà dans le bon de commande", 400, cancellation: ct); + return; } PurchaseProduct? productOnPurchase = mapper.Map(line); From cac880e35f853824ce498347bc6d3894464a0099 Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Wed, 27 May 2026 12:32:27 +0100 Subject: [PATCH 40/51] Add endpoint to display all customers, and updated dto to create quotation and purchase order --- .../DTO/Customer/Response/GetCustomerDto.cs | 7 +++++++ .../Request/CreatePurchaseOrderDto.cs | 1 + .../Quotation/Request/CreateQuotationDto.cs | 2 ++ .../Customers/GetAllCustomersEndpoint.cs | 19 +++++++++++++++++++ .../MappingProfiles/EntityToDtoMappings.cs | 3 +++ PyroFetes/Program.cs | 1 + PyroFetes/Repositories/CustomersRepository.cs | 5 +++++ 7 files changed, 38 insertions(+) create mode 100644 PyroFetes/DTO/Customer/Response/GetCustomerDto.cs create mode 100644 PyroFetes/Endpoints/Customers/GetAllCustomersEndpoint.cs create mode 100644 PyroFetes/Repositories/CustomersRepository.cs diff --git a/PyroFetes/DTO/Customer/Response/GetCustomerDto.cs b/PyroFetes/DTO/Customer/Response/GetCustomerDto.cs new file mode 100644 index 0000000..53105bf --- /dev/null +++ b/PyroFetes/DTO/Customer/Response/GetCustomerDto.cs @@ -0,0 +1,7 @@ +namespace PyroFetes.DTO.Customer.Response; + +public class GetCustomerDto +{ + public int Id { get; set; } + public string? Note { get; set; } +} \ No newline at end of file diff --git a/PyroFetes/DTO/PurchaseOrder/Request/CreatePurchaseOrderDto.cs b/PyroFetes/DTO/PurchaseOrder/Request/CreatePurchaseOrderDto.cs index 12e3c20..87d17c1 100644 --- a/PyroFetes/DTO/PurchaseOrder/Request/CreatePurchaseOrderDto.cs +++ b/PyroFetes/DTO/PurchaseOrder/Request/CreatePurchaseOrderDto.cs @@ -5,5 +5,6 @@ namespace PyroFetes.DTO.PurchaseOrder.Request; public class CreatePurchaseOrderDto { public string? PurchaseConditions { get; set; } + public int SupplierId { get; set; } public List? Products { get; set; } } \ No newline at end of file diff --git a/PyroFetes/DTO/Quotation/Request/CreateQuotationDto.cs b/PyroFetes/DTO/Quotation/Request/CreateQuotationDto.cs index e775c9f..890f999 100644 --- a/PyroFetes/DTO/Quotation/Request/CreateQuotationDto.cs +++ b/PyroFetes/DTO/Quotation/Request/CreateQuotationDto.cs @@ -6,5 +6,7 @@ public class CreateQuotationDto { public string? Message { get; set; } public string? ConditionsSale { get; set; } + public int CustomerId { get; set; } + public int SupplierId { get; set; } public List? Products { get; set; } } \ No newline at end of file diff --git a/PyroFetes/Endpoints/Customers/GetAllCustomersEndpoint.cs b/PyroFetes/Endpoints/Customers/GetAllCustomersEndpoint.cs new file mode 100644 index 0000000..75503af --- /dev/null +++ b/PyroFetes/Endpoints/Customers/GetAllCustomersEndpoint.cs @@ -0,0 +1,19 @@ +using FastEndpoints; +using PyroFetes.DTO.Customer.Response; +using PyroFetes.Repositories; + +namespace PyroFetes.Endpoints.Customers; + +public class GetAllCustomersEndpoint(CustomersRepository customersRepository, AutoMapper.IMapper mapper) : EndpointWithoutRequest> +{ + public override void Configure() + { + Get("/customers"); + AllowAnonymous(); + } + + public override async Task HandleAsync(CancellationToken ct) + { + await Send.OkAsync(await customersRepository.ProjectToListAsync(ct), ct); + } +} \ No newline at end of file diff --git a/PyroFetes/MappingProfiles/EntityToDtoMappings.cs b/PyroFetes/MappingProfiles/EntityToDtoMappings.cs index 6e4c985..3e5ea84 100644 --- a/PyroFetes/MappingProfiles/EntityToDtoMappings.cs +++ b/PyroFetes/MappingProfiles/EntityToDtoMappings.cs @@ -1,4 +1,5 @@ using AutoMapper; +using PyroFetes.DTO.Customer.Response; using PyroFetes.DTO.Deliverer.Response; using PyroFetes.DTO.DeliveryNote.Response; using PyroFetes.DTO.Price.Response; @@ -59,5 +60,7 @@ public class EntityToDtoMappings : Profile CreateMap(); CreateMap(); + + CreateMap(); } } \ No newline at end of file diff --git a/PyroFetes/Program.cs b/PyroFetes/Program.cs index bf236f3..262fbb2 100644 --- a/PyroFetes/Program.cs +++ b/PyroFetes/Program.cs @@ -50,6 +50,7 @@ builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); +builder.Services.AddScoped(); // Ajout des services builder.Services.AddScoped(); diff --git a/PyroFetes/Repositories/CustomersRepository.cs b/PyroFetes/Repositories/CustomersRepository.cs new file mode 100644 index 0000000..ba29a90 --- /dev/null +++ b/PyroFetes/Repositories/CustomersRepository.cs @@ -0,0 +1,5 @@ +using PyroFetes.Models; + +namespace PyroFetes.Repositories; + +public class CustomersRepository(PyroFetesDbContext pyrofetesContext, AutoMapper.IMapper mapper) : PyrofetesRepository(pyrofetesContext, mapper); \ No newline at end of file From 6f2c60e6c01eea9d9a338e939c5f94b24293b8d5 Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Wed, 27 May 2026 13:12:57 +0100 Subject: [PATCH 41/51] Fixed error with inclusion in pdf of quotation --- PyroFetes/Endpoints/Quotations/CreateQuotationEndpoint.cs | 1 - PyroFetes/Services/Pdf/QuotationPdfService.cs | 3 ++- .../Quotations/GetQuotationByIdWithProductsSpec.cs | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/PyroFetes/Endpoints/Quotations/CreateQuotationEndpoint.cs b/PyroFetes/Endpoints/Quotations/CreateQuotationEndpoint.cs index f8b2f9a..4dfcda5 100644 --- a/PyroFetes/Endpoints/Quotations/CreateQuotationEndpoint.cs +++ b/PyroFetes/Endpoints/Quotations/CreateQuotationEndpoint.cs @@ -23,7 +23,6 @@ public class CreateQuotationEndpoint( public override async Task HandleAsync(CreateQuotationDto req, CancellationToken ct) { Quotation quotation = mapper.Map(req); - quotation.CustomerId = 1; // TODO: A changer await quotationsRepository.AddAsync(quotation, ct); if (req.Products != null) diff --git a/PyroFetes/Services/Pdf/QuotationPdfService.cs b/PyroFetes/Services/Pdf/QuotationPdfService.cs index 87204e7..9456932 100644 --- a/PyroFetes/Services/Pdf/QuotationPdfService.cs +++ b/PyroFetes/Services/Pdf/QuotationPdfService.cs @@ -35,7 +35,8 @@ public class QuotationPdfService : IQuotationPdfService col.Item().Text(""); col.Item().Text(""); col.Item().Text("Client").SemiBold().FontSize(12); - col.Item().Text($"{quotation.Customer}"); + col.Item().Text($"{quotation.Customer?.Note}"); + col.Item().Text($"{quotation.Customer?.CustomerType?.Label}"); }); // Logo + société à droite diff --git a/PyroFetes/Specifications/Quotations/GetQuotationByIdWithProductsSpec.cs b/PyroFetes/Specifications/Quotations/GetQuotationByIdWithProductsSpec.cs index b7f0e88..b689f14 100644 --- a/PyroFetes/Specifications/Quotations/GetQuotationByIdWithProductsSpec.cs +++ b/PyroFetes/Specifications/Quotations/GetQuotationByIdWithProductsSpec.cs @@ -11,6 +11,8 @@ public class GetQuotationByIdWithProductsSpec : SingleResultSpecification x.Id == quotationId) .Include(x => x.QuotationProducts!) .ThenInclude(x => x.Product) - .ThenInclude(x => x!.Prices); + .ThenInclude(x => x!.Prices) + .Include(x => x.Customer) + .ThenInclude(x => x!.CustomerType); } } \ No newline at end of file From 6339fbdb8c2f1afaa7aef22a5be9afbb86691dab Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Wed, 27 May 2026 17:23:02 +0100 Subject: [PATCH 42/51] Added spec for see all documents order by desc --- .../PurchaseOrders/GetAllPurchaseOrderEndpoint.cs | 3 ++- .../Quotations/GetAllQuotationEndpoint.cs | 3 ++- .../Products/GetProductsUnderLimitSpec.cs | 3 ++- .../PurchaseOrders/GetAllPurchaseOrderSpec.cs | 14 ++++++++++++++ .../Quotations/GetAllQuotationSpec.cs | 14 ++++++++++++++ 5 files changed, 34 insertions(+), 3 deletions(-) create mode 100644 PyroFetes/Specifications/PurchaseOrders/GetAllPurchaseOrderSpec.cs create mode 100644 PyroFetes/Specifications/Quotations/GetAllQuotationSpec.cs diff --git a/PyroFetes/Endpoints/PurchaseOrders/GetAllPurchaseOrderEndpoint.cs b/PyroFetes/Endpoints/PurchaseOrders/GetAllPurchaseOrderEndpoint.cs index 8a3dd58..09d7dcb 100644 --- a/PyroFetes/Endpoints/PurchaseOrders/GetAllPurchaseOrderEndpoint.cs +++ b/PyroFetes/Endpoints/PurchaseOrders/GetAllPurchaseOrderEndpoint.cs @@ -1,6 +1,7 @@ using FastEndpoints; using PyroFetes.DTO.PurchaseOrder.Response; using PyroFetes.Repositories; +using PyroFetes.Specifications.PurchaseOrders; namespace PyroFetes.Endpoints.PurchaseOrders; @@ -14,6 +15,6 @@ public class GetAllPurchaseOrderEndpoint(PurchaseOrdersRepository purchaseOrders public override async Task HandleAsync(CancellationToken ct) { - await Send.OkAsync(await purchaseOrdersRepository.ProjectToListAsync(ct), ct); + await Send.OkAsync(await purchaseOrdersRepository.ProjectToListAsync(new GetAllPurchaseOrderSpec(), ct), ct); } } \ No newline at end of file diff --git a/PyroFetes/Endpoints/Quotations/GetAllQuotationEndpoint.cs b/PyroFetes/Endpoints/Quotations/GetAllQuotationEndpoint.cs index 9d7059d..bccafd3 100644 --- a/PyroFetes/Endpoints/Quotations/GetAllQuotationEndpoint.cs +++ b/PyroFetes/Endpoints/Quotations/GetAllQuotationEndpoint.cs @@ -1,6 +1,7 @@ using FastEndpoints; using PyroFetes.DTO.Quotation.Response; using PyroFetes.Repositories; +using PyroFetes.Specifications.Quotations; namespace PyroFetes.Endpoints.Quotations; @@ -14,6 +15,6 @@ public class GetAllQuotationEndpoint(QuotationsRepository quotationsRepository) public override async Task HandleAsync(CancellationToken ct) { - await Send.OkAsync(await quotationsRepository.ProjectToListAsync(ct), ct); + await Send.OkAsync(await quotationsRepository.ProjectToListAsync(new GetAllQuotationSpec(), ct), ct); } } \ No newline at end of file diff --git a/PyroFetes/Specifications/Products/GetProductsUnderLimitSpec.cs b/PyroFetes/Specifications/Products/GetProductsUnderLimitSpec.cs index 5b3c1f4..df57b0c 100644 --- a/PyroFetes/Specifications/Products/GetProductsUnderLimitSpec.cs +++ b/PyroFetes/Specifications/Products/GetProductsUnderLimitSpec.cs @@ -9,6 +9,7 @@ public sealed class GetProductsUnderLimitSpec : Specification { Query .Include(x => x.WarehouseProducts) - .Where(x => x.WarehouseProducts != null && x.WarehouseProducts.Sum(p => p.Quantity) < x.MinimalQuantity); + .Where(x => x.WarehouseProducts != null && x.WarehouseProducts.Sum(p => p.Quantity) < x.MinimalQuantity + && !x.ProductDeliveries!.Any(d => d.DeliveryNote!.RealDeliveryDate == null)); } } \ No newline at end of file diff --git a/PyroFetes/Specifications/PurchaseOrders/GetAllPurchaseOrderSpec.cs b/PyroFetes/Specifications/PurchaseOrders/GetAllPurchaseOrderSpec.cs new file mode 100644 index 0000000..827d952 --- /dev/null +++ b/PyroFetes/Specifications/PurchaseOrders/GetAllPurchaseOrderSpec.cs @@ -0,0 +1,14 @@ +using Ardalis.Specification; +using PyroFetes.Models; + +namespace PyroFetes.Specifications.PurchaseOrders; + +public class GetAllPurchaseOrderSpec : Specification +{ + public GetAllPurchaseOrderSpec() + { + Query + .Where(x => true) + .OrderByDescending(x => x.Id); + } +} \ No newline at end of file diff --git a/PyroFetes/Specifications/Quotations/GetAllQuotationSpec.cs b/PyroFetes/Specifications/Quotations/GetAllQuotationSpec.cs new file mode 100644 index 0000000..e386950 --- /dev/null +++ b/PyroFetes/Specifications/Quotations/GetAllQuotationSpec.cs @@ -0,0 +1,14 @@ +using Ardalis.Specification; +using PyroFetes.Models; + +namespace PyroFetes.Specifications.Quotations; + +public class GetAllQuotationSpec : Specification +{ + public GetAllQuotationSpec() + { + Query + .Where(x => true) + .OrderByDescending(x => x.Id); + } +} \ No newline at end of file From 88882f9db81585138cf311746c77e60bd1ba3566 Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Wed, 27 May 2026 17:48:30 +0100 Subject: [PATCH 43/51] Deleted date of delivery note dto --- PyroFetes/DTO/DeliveryNote/Request/CreateDeliveryNoteDto.cs | 2 -- .../Endpoints/DeliveryNotes/CreateDeliveryNoteEndpoint.cs | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/PyroFetes/DTO/DeliveryNote/Request/CreateDeliveryNoteDto.cs b/PyroFetes/DTO/DeliveryNote/Request/CreateDeliveryNoteDto.cs index 42c4bb3..3dbde13 100644 --- a/PyroFetes/DTO/DeliveryNote/Request/CreateDeliveryNoteDto.cs +++ b/PyroFetes/DTO/DeliveryNote/Request/CreateDeliveryNoteDto.cs @@ -3,8 +3,6 @@ namespace PyroFetes.DTO.DeliveryNote.Request; public class CreateDeliveryNoteDto { public string? TrackingNumber { get; set; } - public DateOnly EstimateDeliveryDate { get; set; } - public DateOnly ExpeditionDate { get; set; } public int DelivererId { get; set; } public int SupplierId { get; set; } diff --git a/PyroFetes/Endpoints/DeliveryNotes/CreateDeliveryNoteEndpoint.cs b/PyroFetes/Endpoints/DeliveryNotes/CreateDeliveryNoteEndpoint.cs index 4781faa..36335bf 100644 --- a/PyroFetes/Endpoints/DeliveryNotes/CreateDeliveryNoteEndpoint.cs +++ b/PyroFetes/Endpoints/DeliveryNotes/CreateDeliveryNoteEndpoint.cs @@ -35,8 +35,8 @@ public class CreateDeliveryNoteEndpoint( DeliveryNote newDeliveryNote = new() { TrackingNumber = req.TrackingNumber, - EstimateDeliveryDate = req.EstimateDeliveryDate, - ExpeditionDate = req.ExpeditionDate, + EstimateDeliveryDate = DateOnly.FromDateTime(DateTime.Today).AddMonths(2), + ExpeditionDate = DateOnly.FromDateTime(DateTime.Today), DelivererId = deliverer.Id, Deliverer = deliverer, SupplierId = req.SupplierId, From 76239b41bdac0b9332caf42c002409a79fa0fb39 Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Wed, 27 May 2026 18:02:03 +0100 Subject: [PATCH 44/51] Adapt endpoint to UX --- PyroFetes/Endpoints/PurchaseOrders/CreatePurchaseOrder.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/PyroFetes/Endpoints/PurchaseOrders/CreatePurchaseOrder.cs b/PyroFetes/Endpoints/PurchaseOrders/CreatePurchaseOrder.cs index 977c914..28fc2a4 100644 --- a/PyroFetes/Endpoints/PurchaseOrders/CreatePurchaseOrder.cs +++ b/PyroFetes/Endpoints/PurchaseOrders/CreatePurchaseOrder.cs @@ -1,5 +1,6 @@ using FastEndpoints; using PyroFetes.DTO.PurchaseOrder.Request; +using PyroFetes.DTO.PurchaseOrder.Response; using PyroFetes.DTO.PurchaseProduct.Request; using PyroFetes.Models; using PyroFetes.Repositories; @@ -12,7 +13,7 @@ public class CreatePurchaseOrder( PurchaseOrdersRepository purchaseOrdersRepository, ProductsRepository productsRepository, PurchaseProductsRepository purchaseProductsRepository, - AutoMapper.IMapper mapper) : Endpoint + AutoMapper.IMapper mapper) : Endpoint { public override void Configure() { @@ -51,6 +52,6 @@ public class CreatePurchaseOrder( await purchaseProductsRepository.AddAsync(productOnPurchase, ct); } } - await Send.NoContentAsync(ct); + await Send.OkAsync(mapper.Map(purchaseOrder), ct); } } \ No newline at end of file From fc9da89ebe541430ae7bf74cd3ab304a6a6d27c7 Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Thu, 28 May 2026 14:05:47 +0100 Subject: [PATCH 45/51] Added refresh token endpoint --- .../DTO/Refresh/Request/RefreshTokenDto.cs | 6 ++ .../Refresh/Response/GetRefreshTokenDto.cs | 6 ++ .../Endpoints/Refresh/RefreshTokenEndpoint.cs | 62 +++++++++++++++++++ .../Endpoints/Users/ConnectUserEndpoint.cs | 2 +- PyroFetes/Program.cs | 2 +- 5 files changed, 76 insertions(+), 2 deletions(-) create mode 100644 PyroFetes/DTO/Refresh/Request/RefreshTokenDto.cs create mode 100644 PyroFetes/DTO/Refresh/Response/GetRefreshTokenDto.cs create mode 100644 PyroFetes/Endpoints/Refresh/RefreshTokenEndpoint.cs diff --git a/PyroFetes/DTO/Refresh/Request/RefreshTokenDto.cs b/PyroFetes/DTO/Refresh/Request/RefreshTokenDto.cs new file mode 100644 index 0000000..ab2c503 --- /dev/null +++ b/PyroFetes/DTO/Refresh/Request/RefreshTokenDto.cs @@ -0,0 +1,6 @@ +namespace PyroFetes.DTO.Refresh.Request; + +public class RefreshTokenDto +{ + public string? Token { get; set; } +} \ No newline at end of file diff --git a/PyroFetes/DTO/Refresh/Response/GetRefreshTokenDto.cs b/PyroFetes/DTO/Refresh/Response/GetRefreshTokenDto.cs new file mode 100644 index 0000000..ac16d1e --- /dev/null +++ b/PyroFetes/DTO/Refresh/Response/GetRefreshTokenDto.cs @@ -0,0 +1,6 @@ +namespace PyroFetes.DTO.Refresh.Response; + +public class GetRefreshTokenDto +{ + public string? Token { get; set; } +} \ No newline at end of file diff --git a/PyroFetes/Endpoints/Refresh/RefreshTokenEndpoint.cs b/PyroFetes/Endpoints/Refresh/RefreshTokenEndpoint.cs new file mode 100644 index 0000000..b11b418 --- /dev/null +++ b/PyroFetes/Endpoints/Refresh/RefreshTokenEndpoint.cs @@ -0,0 +1,62 @@ +using System.IdentityModel.Tokens.Jwt; +using FastEndpoints; +using FastEndpoints.Security; +using PyroFetes.DTO.Refresh.Request; +using PyroFetes.DTO.Refresh.Response; +using PyroFetes.Models; +using PyroFetes.Repositories; +using PyroFetes.Specifications.Users; + +namespace PyroFetes.Endpoints.Refresh; + +public class RefreshTokenEndpoint(UsersRepository usersRepository) : Endpoint +{ + public override void Configure() + { + Post("/refresh"); + AllowAnonymous(); + } + + public override async Task HandleAsync(RefreshTokenDto req, CancellationToken ct) + { + try + { + JwtSecurityTokenHandler handler = new(); + JwtSecurityToken? token = handler.ReadJwtToken(req.Token); + string? username = token.Claims.FirstOrDefault(c => c.Type == "Name")?.Value; + + if (string.IsNullOrWhiteSpace(username)) + { + await Send.UnauthorizedAsync(ct); + return; + } + + User? login = await usersRepository.SingleOrDefaultAsync(new GetUserByNameSpec(username), ct); + if (login == null) + { + await Send.UnauthorizedAsync(ct); + return; + } + + string jwtToken = JwtBearer.CreateToken(o => + { + o.SigningKey = "v9!Qx7#Lk2@pZ8$wR6!tN5%uF3&cD9^mH1*eY4"; + o.ExpireAt = DateTime.UtcNow.AddMinutes(15); + if (login.Fonction is not null) o.User.Roles.Add(login.Fonction); + o.User.Claims.Add(("Name", login.Name)!); + o.User.Claims.Add(("Id", login.Id.ToString())!); + }); + + GetRefreshTokenDto responseDto = new() + { + Token = jwtToken + }; + + await Send.OkAsync(responseDto, ct); + } + catch + { + await Send.UnauthorizedAsync(ct); + } + } +} \ No newline at end of file diff --git a/PyroFetes/Endpoints/Users/ConnectUserEndpoint.cs b/PyroFetes/Endpoints/Users/ConnectUserEndpoint.cs index 14314c0..d7931fa 100644 --- a/PyroFetes/Endpoints/Users/ConnectUserEndpoint.cs +++ b/PyroFetes/Endpoints/Users/ConnectUserEndpoint.cs @@ -31,7 +31,7 @@ public class ConnectUserEndpoint(UsersRepository usersRepository) : Endpoint { - o.SigningKey = "ThisIsASuperSecretJwtKeyThatIsAtLeast32CharsLong"; + o.SigningKey = "v9!Qx7#Lk2@pZ8$wR6!tN5%uF3&cD9^mH1*eY4"; o.ExpireAt = DateTime.UtcNow.AddMinutes(15); if (user.Fonction is not null) o.User.Roles.Add(user.Fonction); o.User.Claims.Add(("Name", user.Name)!); diff --git a/PyroFetes/Program.cs b/PyroFetes/Program.cs index 262fbb2..e78ef20 100644 --- a/PyroFetes/Program.cs +++ b/PyroFetes/Program.cs @@ -17,7 +17,7 @@ QuestPDF.Settings.License = LicenseType.Community; // On ajoute ici FastEndpoints, un framework REPR et Swagger aux services disponibles dans le projet builder.Services - .AddAuthenticationJwtBearer(s => s.SigningKey = "ThisIsASuperSecretJwtKeyThatIsAtLeast32CharsLong") + .AddAuthenticationJwtBearer(s => s.SigningKey = "v9!Qx7#Lk2@pZ8$wR6!tN5%uF3&cD9^mH1*eY4") .AddAuthorization() .AddFastEndpoints() .SwaggerDocument(options => { options.ShortSchemaNames = true; }) From 5869ae18c451d3292c2c5db0717e874f1b8f59eb Mon Sep 17 00:00:00 2001 From: Cristiano Date: Thu, 28 May 2026 15:36:33 +0200 Subject: [PATCH 46/51] Put roles into endpoints --- PyroFetes/Endpoints/Customers/GetAllCustomersEndpoint.cs | 2 +- PyroFetes/Endpoints/Deliverers/CreateDelivererEndpoint.cs | 2 +- PyroFetes/Endpoints/Deliverers/DeleteDelivererEndpoint.cs | 2 +- PyroFetes/Endpoints/Deliverers/GetAllDelivererEndpoint.cs | 2 +- PyroFetes/Endpoints/Deliverers/GetDelivererEndpoint.cs | 2 +- PyroFetes/Endpoints/Deliverers/UpdateDelivererEndpoint.cs | 2 +- .../Endpoints/DeliveryNotes/CreateDeliveryNoteEndpoint.cs | 2 +- .../Endpoints/DeliveryNotes/DeleteDeliveryNoteEndpoint.cs | 2 +- .../Endpoints/DeliveryNotes/GetAllDeliveryNoteEndpoint.cs | 2 +- .../DeliveryNotes/GetAllDeliveryNotesNotArrivedEndpoint.cs | 2 +- PyroFetes/Endpoints/DeliveryNotes/GetDeliveryNoteEndpoint.cs | 2 +- .../Endpoints/DeliveryNotes/GetDeliveryNotePdfEndpoint.cs | 2 +- .../Endpoints/DeliveryNotes/PatchRealDeliveryDateEndpoint.cs | 2 +- .../Endpoints/DeliveryNotes/UpdateDeliveryNoteEndpoint.cs | 2 +- PyroFetes/Endpoints/Products/DeleteProductEndpoint.cs | 3 ++- PyroFetes/Endpoints/Products/GetAllProductsEndpoint.cs | 2 +- .../Endpoints/Products/GetAllProductsUnderLimitEndpoint.cs | 2 +- PyroFetes/Endpoints/Products/GetProductEndpoint.cs | 3 ++- .../Endpoints/Products/PatchProductMinimalStockEndpoint.cs | 2 +- PyroFetes/Endpoints/Products/UpdateProductEndpoint.cs | 2 +- .../PurchaseOrders/AddProductFromPurchaseOrderEndpoint.cs | 2 +- PyroFetes/Endpoints/PurchaseOrders/CreatePurchaseOrder.cs | 2 +- .../PurchaseOrders/DeleteProductFromPurchaseOrderEndpoint.cs | 2 +- .../Endpoints/PurchaseOrders/DeletePurchaseOrderEndpoint.cs | 3 ++- .../Endpoints/PurchaseOrders/GetAllPurchaseOrderEndpoint.cs | 2 +- PyroFetes/Endpoints/PurchaseOrders/GetPurchaseOrderEndpoint.cs | 2 +- .../Endpoints/PurchaseOrders/GetPurchaseOrderPdfEndpoint.cs | 2 +- .../PatchPurchaseOrderPurchaseConditionsEndpoint.cs | 2 +- .../PurchaseOrders/PatchPurchaseProductQuantityEndpoint.cs | 2 +- .../Endpoints/Quotations/AddProductoToQuotationEndpoint.cs | 2 +- PyroFetes/Endpoints/Quotations/CreateQuotationEndpoint.cs | 2 +- .../Endpoints/Quotations/DeleteProductFromQuotationEndpoint.cs | 2 +- PyroFetes/Endpoints/Quotations/DeleteQuotationEndpoint.cs | 3 ++- PyroFetes/Endpoints/Quotations/GetAllQuotationEndpoint.cs | 2 +- PyroFetes/Endpoints/Quotations/GetQuotationEndpoint.cs | 2 +- PyroFetes/Endpoints/Quotations/GetQuotationPdfEndpoint.cs | 2 +- .../Quotations/PatchQuotationConditionsSaleEndpoint.cs | 2 +- .../Endpoints/Quotations/PatchQuotationMessageEndpoint.cs | 2 +- .../Quotations/PatchQuotationProductQuantityEndpoint.cs | 2 +- PyroFetes/Endpoints/Quotations/UpdateQuotationEndpoint.cs | 3 ++- PyroFetes/Endpoints/Settings/GetSettingEndpoint.cs | 2 +- .../Settings/PatchSettingElectronicSignatureEndpoint.cs | 3 ++- PyroFetes/Endpoints/Settings/PatchSettingLogoEndpoint.cs | 2 +- PyroFetes/Endpoints/Suppliers/AddProductToSupplierEndpoint.cs | 2 +- PyroFetes/Endpoints/Suppliers/CreateSupplierEndpoint.cs | 2 +- .../Endpoints/Suppliers/DeleteProductToSupplierEndpoint.cs | 2 +- PyroFetes/Endpoints/Suppliers/DeleteSupplierEndpoint.cs | 2 +- PyroFetes/Endpoints/Suppliers/GetAllSuppliersEndpoint.cs | 2 +- PyroFetes/Endpoints/Suppliers/GetSupplierEndpoint.cs | 2 +- PyroFetes/Endpoints/Suppliers/PatchPriceEndpoint.cs | 2 +- .../Endpoints/Suppliers/PatchSupplierDeliveryDelayEndpoint.cs | 3 ++- PyroFetes/Endpoints/Suppliers/UpdateSupplierEndpoint.cs | 2 +- PyroFetes/Endpoints/Users/CreateUserEndpoint.cs | 2 +- PyroFetes/Endpoints/Users/DeleteUserEndpoint.cs | 2 +- PyroFetes/Endpoints/Users/GetAllUsersEndpoint.cs | 2 +- PyroFetes/Endpoints/Users/GetUserEndpoint.cs | 2 +- PyroFetes/Endpoints/Users/PatchUserPasswordEndpoint.cs | 2 +- PyroFetes/Endpoints/Users/UpdateUserEndpoint.cs | 2 +- PyroFetes/Endpoints/WareHouse/GetAllWarehouseEndpoint.cs | 2 +- .../Endpoints/WareHouseProducts/GetTotalQuantityEndpoint.cs | 2 +- .../WareHouseProducts/PatchWareHouseProductQuantityEndpoint.cs | 2 +- 61 files changed, 68 insertions(+), 61 deletions(-) diff --git a/PyroFetes/Endpoints/Customers/GetAllCustomersEndpoint.cs b/PyroFetes/Endpoints/Customers/GetAllCustomersEndpoint.cs index 75503af..4fc3e17 100644 --- a/PyroFetes/Endpoints/Customers/GetAllCustomersEndpoint.cs +++ b/PyroFetes/Endpoints/Customers/GetAllCustomersEndpoint.cs @@ -9,7 +9,7 @@ public class GetAllCustomersEndpoint(CustomersRepository customersRepository, Au public override void Configure() { Get("/customers"); - AllowAnonymous(); + Roles("Admin","Employe"); } public override async Task HandleAsync(CancellationToken ct) diff --git a/PyroFetes/Endpoints/Deliverers/CreateDelivererEndpoint.cs b/PyroFetes/Endpoints/Deliverers/CreateDelivererEndpoint.cs index f531045..c78bb26 100644 --- a/PyroFetes/Endpoints/Deliverers/CreateDelivererEndpoint.cs +++ b/PyroFetes/Endpoints/Deliverers/CreateDelivererEndpoint.cs @@ -11,7 +11,7 @@ public class CreateDelivererEndpoint(DeliverersRepository deliverersRepository) public override void Configure() { Post("/deliverers"); - AllowAnonymous(); + Roles("Admin","Employe"); } public override async Task HandleAsync(CreateDelivererDto req, CancellationToken ct) diff --git a/PyroFetes/Endpoints/Deliverers/DeleteDelivererEndpoint.cs b/PyroFetes/Endpoints/Deliverers/DeleteDelivererEndpoint.cs index 31ee092..df8c6bc 100644 --- a/PyroFetes/Endpoints/Deliverers/DeleteDelivererEndpoint.cs +++ b/PyroFetes/Endpoints/Deliverers/DeleteDelivererEndpoint.cs @@ -15,7 +15,7 @@ public class DeleteDelivererEndpoint(DeliverersRepository deliverersRepository) public override void Configure() { Delete("/deliverers/{@Id}", x => new { x.DelivererId }); - AllowAnonymous(); + Roles("Admin"); } public override async Task HandleAsync(DeleteDelivererRequest req, CancellationToken ct) diff --git a/PyroFetes/Endpoints/Deliverers/GetAllDelivererEndpoint.cs b/PyroFetes/Endpoints/Deliverers/GetAllDelivererEndpoint.cs index b30d02f..b635ef7 100644 --- a/PyroFetes/Endpoints/Deliverers/GetAllDelivererEndpoint.cs +++ b/PyroFetes/Endpoints/Deliverers/GetAllDelivererEndpoint.cs @@ -9,7 +9,7 @@ public class GetAllDelivererEndpoint(DeliverersRepository deliverersRepository) public override void Configure() { Get("/deliverers"); - AllowAnonymous(); + Roles("Admin","Employe"); } public override async Task HandleAsync(CancellationToken ct) diff --git a/PyroFetes/Endpoints/Deliverers/GetDelivererEndpoint.cs b/PyroFetes/Endpoints/Deliverers/GetDelivererEndpoint.cs index 640d0c2..bc6b259 100644 --- a/PyroFetes/Endpoints/Deliverers/GetDelivererEndpoint.cs +++ b/PyroFetes/Endpoints/Deliverers/GetDelivererEndpoint.cs @@ -16,7 +16,7 @@ public class GetDelivererEndpoint(DeliverersRepository deliverersRepository, Aut public override void Configure() { Get("/deliverers/{@Id}", x => new { x.DelivererId }); - AllowAnonymous(); + Roles("Admin","Employe"); } public override async Task HandleAsync(GetDelivererRequest req, CancellationToken ct) diff --git a/PyroFetes/Endpoints/Deliverers/UpdateDelivererEndpoint.cs b/PyroFetes/Endpoints/Deliverers/UpdateDelivererEndpoint.cs index a9b38f5..c9fd77c 100644 --- a/PyroFetes/Endpoints/Deliverers/UpdateDelivererEndpoint.cs +++ b/PyroFetes/Endpoints/Deliverers/UpdateDelivererEndpoint.cs @@ -12,7 +12,7 @@ public class UpdateDelivererEndpoint(DeliverersRepository deliverersRepository, public override void Configure() { Put("/deliverers/{@Id}", x => new { x.Id }); - AllowAnonymous(); + Roles("Admin"); } public override async Task HandleAsync(UpdateDelivererDto req, CancellationToken ct) diff --git a/PyroFetes/Endpoints/DeliveryNotes/CreateDeliveryNoteEndpoint.cs b/PyroFetes/Endpoints/DeliveryNotes/CreateDeliveryNoteEndpoint.cs index 36335bf..01834a7 100644 --- a/PyroFetes/Endpoints/DeliveryNotes/CreateDeliveryNoteEndpoint.cs +++ b/PyroFetes/Endpoints/DeliveryNotes/CreateDeliveryNoteEndpoint.cs @@ -18,7 +18,7 @@ public class CreateDeliveryNoteEndpoint( public override void Configure() { Post("/deliveryNotes"); - AllowAnonymous(); + Roles("Admin","Employe"); } public override async Task HandleAsync(CreateDeliveryNoteDto req, CancellationToken ct) diff --git a/PyroFetes/Endpoints/DeliveryNotes/DeleteDeliveryNoteEndpoint.cs b/PyroFetes/Endpoints/DeliveryNotes/DeleteDeliveryNoteEndpoint.cs index bc14d89..b2c9f7b 100644 --- a/PyroFetes/Endpoints/DeliveryNotes/DeleteDeliveryNoteEndpoint.cs +++ b/PyroFetes/Endpoints/DeliveryNotes/DeleteDeliveryNoteEndpoint.cs @@ -16,7 +16,7 @@ public class DeleteDeliveryNoteEndpoint( public override void Configure() { Delete("/deliveryNotes/{@Id}", x => new { x.Id }); - AllowAnonymous(); + Roles("Admin"); } public override async Task HandleAsync(DeleteDeliveryNoteRequest req, CancellationToken ct) diff --git a/PyroFetes/Endpoints/DeliveryNotes/GetAllDeliveryNoteEndpoint.cs b/PyroFetes/Endpoints/DeliveryNotes/GetAllDeliveryNoteEndpoint.cs index 4fbadbe..480983d 100644 --- a/PyroFetes/Endpoints/DeliveryNotes/GetAllDeliveryNoteEndpoint.cs +++ b/PyroFetes/Endpoints/DeliveryNotes/GetAllDeliveryNoteEndpoint.cs @@ -10,7 +10,7 @@ public class GetAllDeliveryNoteEndpoint(DeliveryNotesRepository deliveryNotesRep public override void Configure() { Get("/deliveryNotes"); - AllowAnonymous(); + Roles("Admin","Employe"); } public override async Task HandleAsync(CancellationToken ct) diff --git a/PyroFetes/Endpoints/DeliveryNotes/GetAllDeliveryNotesNotArrivedEndpoint.cs b/PyroFetes/Endpoints/DeliveryNotes/GetAllDeliveryNotesNotArrivedEndpoint.cs index 07cdaeb..7693ac9 100644 --- a/PyroFetes/Endpoints/DeliveryNotes/GetAllDeliveryNotesNotArrivedEndpoint.cs +++ b/PyroFetes/Endpoints/DeliveryNotes/GetAllDeliveryNotesNotArrivedEndpoint.cs @@ -10,7 +10,7 @@ public class GetAllDeliveryNotesNotArrivedEndpoint(DeliveryNotesRepository deliv public override void Configure() { Get("/deliveryNotes/validation"); - AllowAnonymous(); + Roles("Admin","Employe"); } public override async Task HandleAsync(CancellationToken ct) diff --git a/PyroFetes/Endpoints/DeliveryNotes/GetDeliveryNoteEndpoint.cs b/PyroFetes/Endpoints/DeliveryNotes/GetDeliveryNoteEndpoint.cs index 62597db..6088774 100644 --- a/PyroFetes/Endpoints/DeliveryNotes/GetDeliveryNoteEndpoint.cs +++ b/PyroFetes/Endpoints/DeliveryNotes/GetDeliveryNoteEndpoint.cs @@ -18,7 +18,7 @@ public class GetDeliveryNoteEndpoint( public override void Configure() { Get("/deliveryNotes/{@Id}", x => new { x.DeliveryNoteId }); - AllowAnonymous(); + Roles("Admin","Employe"); } public override async Task HandleAsync(GetDeliveryNoteRequest req, CancellationToken ct) diff --git a/PyroFetes/Endpoints/DeliveryNotes/GetDeliveryNotePdfEndpoint.cs b/PyroFetes/Endpoints/DeliveryNotes/GetDeliveryNotePdfEndpoint.cs index aaaaa7f..dfacbf6 100644 --- a/PyroFetes/Endpoints/DeliveryNotes/GetDeliveryNotePdfEndpoint.cs +++ b/PyroFetes/Endpoints/DeliveryNotes/GetDeliveryNotePdfEndpoint.cs @@ -14,7 +14,7 @@ public class GetDeliveryNotePdfEndpoint(DeliveryNotesRepository deliveryNotesRep public override void Configure() { Get("/deliveryNotes/{@Id}/pdf", x => new { x.Id }); - AllowAnonymous(); + Roles("Admin","Employe"); Description(b => b.Produces(200, MediaTypeNames.Application.Pdf)); } diff --git a/PyroFetes/Endpoints/DeliveryNotes/PatchRealDeliveryDateEndpoint.cs b/PyroFetes/Endpoints/DeliveryNotes/PatchRealDeliveryDateEndpoint.cs index a710044..6bf0485 100644 --- a/PyroFetes/Endpoints/DeliveryNotes/PatchRealDeliveryDateEndpoint.cs +++ b/PyroFetes/Endpoints/DeliveryNotes/PatchRealDeliveryDateEndpoint.cs @@ -13,7 +13,7 @@ public class PatchRealDeliveryDateEndpoint( public override void Configure() { Patch("/deliveryNotes/{@Id}", x => new { x.Id }); - AllowAnonymous(); + Roles("Admin","Employe"); } public override async Task HandleAsync(PatchDeliveryNoteRealDeliveryDateDto req, CancellationToken ct) diff --git a/PyroFetes/Endpoints/DeliveryNotes/UpdateDeliveryNoteEndpoint.cs b/PyroFetes/Endpoints/DeliveryNotes/UpdateDeliveryNoteEndpoint.cs index 6fccf9b..ecf3194 100644 --- a/PyroFetes/Endpoints/DeliveryNotes/UpdateDeliveryNoteEndpoint.cs +++ b/PyroFetes/Endpoints/DeliveryNotes/UpdateDeliveryNoteEndpoint.cs @@ -11,7 +11,7 @@ public class UpdateDeliveryNoteEndpoint(DeliveryNotesRepository deliveryNotesRep public override void Configure() { Put("/deliveryNotes/{@Id}", x => new { x.Id }); - AllowAnonymous(); + Roles("Admin","Employe"); } public override async Task HandleAsync(UpdateDeliveryNoteDto req, CancellationToken ct) diff --git a/PyroFetes/Endpoints/Products/DeleteProductEndpoint.cs b/PyroFetes/Endpoints/Products/DeleteProductEndpoint.cs index a772064..f8465e7 100644 --- a/PyroFetes/Endpoints/Products/DeleteProductEndpoint.cs +++ b/PyroFetes/Endpoints/Products/DeleteProductEndpoint.cs @@ -15,7 +15,8 @@ public class DeleteProductEndpoint(ProductsRepository productsRepository) : Endp public override void Configure() { Delete("/products/{@Id}", x => new { x.ProductId }); - AllowAnonymous(); + Roles("Admin"); + } public override async Task HandleAsync(DeleteProductsRequest req, CancellationToken ct) diff --git a/PyroFetes/Endpoints/Products/GetAllProductsEndpoint.cs b/PyroFetes/Endpoints/Products/GetAllProductsEndpoint.cs index e6c9343..5b36622 100644 --- a/PyroFetes/Endpoints/Products/GetAllProductsEndpoint.cs +++ b/PyroFetes/Endpoints/Products/GetAllProductsEndpoint.cs @@ -9,7 +9,7 @@ public class GetAllProductsEndpoint(ProductsRepository productsRepository) : End public override void Configure() { Get("/products"); - AllowAnonymous(); + Roles("Admin","Employe"); } public override async Task HandleAsync(CancellationToken ct) diff --git a/PyroFetes/Endpoints/Products/GetAllProductsUnderLimitEndpoint.cs b/PyroFetes/Endpoints/Products/GetAllProductsUnderLimitEndpoint.cs index 0b9768f..a509256 100644 --- a/PyroFetes/Endpoints/Products/GetAllProductsUnderLimitEndpoint.cs +++ b/PyroFetes/Endpoints/Products/GetAllProductsUnderLimitEndpoint.cs @@ -10,7 +10,7 @@ public class GetAllProductsUnderLimitEndpoint(ProductsRepository productsReposit public override void Configure() { Get("/products/underLimit"); - AllowAnonymous(); + Roles("Admin","Employe"); } public override async Task HandleAsync(CancellationToken ct) diff --git a/PyroFetes/Endpoints/Products/GetProductEndpoint.cs b/PyroFetes/Endpoints/Products/GetProductEndpoint.cs index efe2a7b..277e90e 100644 --- a/PyroFetes/Endpoints/Products/GetProductEndpoint.cs +++ b/PyroFetes/Endpoints/Products/GetProductEndpoint.cs @@ -18,7 +18,8 @@ public class GetProductEndpoint( public override void Configure() { Get("/products/{@Id}", x => new { x.Id }); - AllowAnonymous(); + Roles("Admin","Employe"); + } public override async Task HandleAsync(GetProductRequest req, CancellationToken ct) diff --git a/PyroFetes/Endpoints/Products/PatchProductMinimalStockEndpoint.cs b/PyroFetes/Endpoints/Products/PatchProductMinimalStockEndpoint.cs index dc2229f..1a27b21 100644 --- a/PyroFetes/Endpoints/Products/PatchProductMinimalStockEndpoint.cs +++ b/PyroFetes/Endpoints/Products/PatchProductMinimalStockEndpoint.cs @@ -11,7 +11,7 @@ public class PatchProductMinimalStockEndpoint(ProductsRepository productsReposit public override void Configure() { Patch("/products/{@Id}/MinimalStock", x => new { x.Id }); - AllowAnonymous(); + Roles("Admin","Employe"); } public override async Task HandleAsync(PatchProductMinimalStockDto req, CancellationToken ct) diff --git a/PyroFetes/Endpoints/Products/UpdateProductEndpoint.cs b/PyroFetes/Endpoints/Products/UpdateProductEndpoint.cs index 81fccdd..ee43e99 100644 --- a/PyroFetes/Endpoints/Products/UpdateProductEndpoint.cs +++ b/PyroFetes/Endpoints/Products/UpdateProductEndpoint.cs @@ -11,7 +11,7 @@ public class UpdateProductEndpoint(ProductsRepository productsRepository, AutoMa public override void Configure() { Put("/products/{@Id}", x => new { x.Id }); - AllowAnonymous(); + Roles("Admin","Employe"); } public override async Task HandleAsync(UpdateProductDto req, CancellationToken ct) diff --git a/PyroFetes/Endpoints/PurchaseOrders/AddProductFromPurchaseOrderEndpoint.cs b/PyroFetes/Endpoints/PurchaseOrders/AddProductFromPurchaseOrderEndpoint.cs index 9a02d20..9df4f09 100644 --- a/PyroFetes/Endpoints/PurchaseOrders/AddProductFromPurchaseOrderEndpoint.cs +++ b/PyroFetes/Endpoints/PurchaseOrders/AddProductFromPurchaseOrderEndpoint.cs @@ -11,7 +11,7 @@ public class AddProductFromPurchaseOrderEndpoint(PurchaseProductsRepository purc public override void Configure() { Post("/purchaseOrders/{@PurchaseOrderId}/{@ProductId}", x => new { x.PurchaseOrderId, x.ProductId }); - AllowAnonymous(); + Roles("Admin","Employe"); } public override async Task HandleAsync(CreatePurchaseProductDto req, CancellationToken ct) diff --git a/PyroFetes/Endpoints/PurchaseOrders/CreatePurchaseOrder.cs b/PyroFetes/Endpoints/PurchaseOrders/CreatePurchaseOrder.cs index 28fc2a4..3947e32 100644 --- a/PyroFetes/Endpoints/PurchaseOrders/CreatePurchaseOrder.cs +++ b/PyroFetes/Endpoints/PurchaseOrders/CreatePurchaseOrder.cs @@ -18,7 +18,7 @@ public class CreatePurchaseOrder( public override void Configure() { Post("/purchaseOrders"); - AllowAnonymous(); + Roles("Admin","Employe"); } public override async Task HandleAsync(CreatePurchaseOrderDto req, CancellationToken ct) diff --git a/PyroFetes/Endpoints/PurchaseOrders/DeleteProductFromPurchaseOrderEndpoint.cs b/PyroFetes/Endpoints/PurchaseOrders/DeleteProductFromPurchaseOrderEndpoint.cs index 8f6274e..ce6505d 100644 --- a/PyroFetes/Endpoints/PurchaseOrders/DeleteProductFromPurchaseOrderEndpoint.cs +++ b/PyroFetes/Endpoints/PurchaseOrders/DeleteProductFromPurchaseOrderEndpoint.cs @@ -16,7 +16,7 @@ public class DeleteProductFromPurchaseOrderEndpoint(PurchaseProductsRepository p public override void Configure() { Delete("/purchaseOrders/{@ProductId}/{@PurchaseOrderId}", x => new { x.ProductId, x.PurchaseOrderId }); - AllowAnonymous(); + Roles("Admin","Employe"); } public override async Task HandleAsync(DeletePurchaseProductRequest req, CancellationToken ct) diff --git a/PyroFetes/Endpoints/PurchaseOrders/DeletePurchaseOrderEndpoint.cs b/PyroFetes/Endpoints/PurchaseOrders/DeletePurchaseOrderEndpoint.cs index b3f077c..a0fe2f1 100644 --- a/PyroFetes/Endpoints/PurchaseOrders/DeletePurchaseOrderEndpoint.cs +++ b/PyroFetes/Endpoints/PurchaseOrders/DeletePurchaseOrderEndpoint.cs @@ -15,7 +15,8 @@ public class DeletePurchaseOrderEndpoint(PurchaseOrdersRepository purchaseOrders public override void Configure() { Delete("/purchaseOrders/{@Id}", x => new { x.Id }); - AllowAnonymous(); + Roles("Admin"); + } public override async Task HandleAsync(DeletePurchaseOrderRequest req, CancellationToken ct) diff --git a/PyroFetes/Endpoints/PurchaseOrders/GetAllPurchaseOrderEndpoint.cs b/PyroFetes/Endpoints/PurchaseOrders/GetAllPurchaseOrderEndpoint.cs index 09d7dcb..6d42c0f 100644 --- a/PyroFetes/Endpoints/PurchaseOrders/GetAllPurchaseOrderEndpoint.cs +++ b/PyroFetes/Endpoints/PurchaseOrders/GetAllPurchaseOrderEndpoint.cs @@ -10,7 +10,7 @@ public class GetAllPurchaseOrderEndpoint(PurchaseOrdersRepository purchaseOrders public override void Configure() { Get("/purchaseOrders"); - AllowAnonymous(); + Roles("Admin","Employe"); } public override async Task HandleAsync(CancellationToken ct) diff --git a/PyroFetes/Endpoints/PurchaseOrders/GetPurchaseOrderEndpoint.cs b/PyroFetes/Endpoints/PurchaseOrders/GetPurchaseOrderEndpoint.cs index c9d906c..9c39ce4 100644 --- a/PyroFetes/Endpoints/PurchaseOrders/GetPurchaseOrderEndpoint.cs +++ b/PyroFetes/Endpoints/PurchaseOrders/GetPurchaseOrderEndpoint.cs @@ -16,7 +16,7 @@ public class GetPurchaseOrderEndpoint(PurchaseOrdersRepository purchaseOrdersRep public override void Configure() { Get("/purchaseOrders/{@Id}", x => new { x.Id }); - AllowAnonymous(); + Roles("Admin","Employe"); } public override async Task HandleAsync(GetPurchaseOrderRequest req, CancellationToken ct) diff --git a/PyroFetes/Endpoints/PurchaseOrders/GetPurchaseOrderPdfEndpoint.cs b/PyroFetes/Endpoints/PurchaseOrders/GetPurchaseOrderPdfEndpoint.cs index 2385163..a532874 100644 --- a/PyroFetes/Endpoints/PurchaseOrders/GetPurchaseOrderPdfEndpoint.cs +++ b/PyroFetes/Endpoints/PurchaseOrders/GetPurchaseOrderPdfEndpoint.cs @@ -17,7 +17,7 @@ public class GetPurchaseOrderPdfEndpoint( public override void Configure() { Get("/purchaseOrders/{@Id}/pdf", x => new { x.Id }); - AllowAnonymous(); + Roles("Admin","Employe"); Description(b => b.Produces(200, MediaTypeNames.Application.Pdf)); } diff --git a/PyroFetes/Endpoints/PurchaseOrders/PatchPurchaseOrderPurchaseConditionsEndpoint.cs b/PyroFetes/Endpoints/PurchaseOrders/PatchPurchaseOrderPurchaseConditionsEndpoint.cs index 0adbae4..f8a516a 100644 --- a/PyroFetes/Endpoints/PurchaseOrders/PatchPurchaseOrderPurchaseConditionsEndpoint.cs +++ b/PyroFetes/Endpoints/PurchaseOrders/PatchPurchaseOrderPurchaseConditionsEndpoint.cs @@ -13,7 +13,7 @@ public class PatchPurchaseOrderPurchaseConditionsEndpoint(PurchaseOrdersReposito public override void Configure() { Patch("/purchaseOrders/{@Id}/PurchaseConditions", x => new { x.Id }); - AllowAnonymous(); + Roles("Admin","Employe"); } public override async Task HandleAsync(PatchPurchaseOrderPurchaseConditionsDto req, CancellationToken ct) diff --git a/PyroFetes/Endpoints/PurchaseOrders/PatchPurchaseProductQuantityEndpoint.cs b/PyroFetes/Endpoints/PurchaseOrders/PatchPurchaseProductQuantityEndpoint.cs index fe32641..3c28f91 100644 --- a/PyroFetes/Endpoints/PurchaseOrders/PatchPurchaseProductQuantityEndpoint.cs +++ b/PyroFetes/Endpoints/PurchaseOrders/PatchPurchaseProductQuantityEndpoint.cs @@ -13,7 +13,7 @@ public class PatchPurchaseProductQuantityEndpoint(PurchaseProductsRepository pur public override void Configure() { Patch("/purchaseOrders/{@ProductId}/{@PurchaseOrderId}/Quantity", x => new { x.ProductId, x.PurchaseOrderId }); - AllowAnonymous(); + Roles("Admin","Employe"); } public override async Task HandleAsync(PatchPurchaseProductQuantityDto req, CancellationToken ct) diff --git a/PyroFetes/Endpoints/Quotations/AddProductoToQuotationEndpoint.cs b/PyroFetes/Endpoints/Quotations/AddProductoToQuotationEndpoint.cs index 8a6c9f4..731d1f6 100644 --- a/PyroFetes/Endpoints/Quotations/AddProductoToQuotationEndpoint.cs +++ b/PyroFetes/Endpoints/Quotations/AddProductoToQuotationEndpoint.cs @@ -14,7 +14,7 @@ public class AddProductoToQuotationEndpoint( public override void Configure() { Post("/quotations/{@Id}/products", x => new { x.ProductId, x.QuotationId }); - AllowAnonymous(); + Roles("Admin","Employe"); } public override async Task HandleAsync(AddQuotationProductDto req, CancellationToken ct) diff --git a/PyroFetes/Endpoints/Quotations/CreateQuotationEndpoint.cs b/PyroFetes/Endpoints/Quotations/CreateQuotationEndpoint.cs index 4dfcda5..2f04dee 100644 --- a/PyroFetes/Endpoints/Quotations/CreateQuotationEndpoint.cs +++ b/PyroFetes/Endpoints/Quotations/CreateQuotationEndpoint.cs @@ -17,7 +17,7 @@ public class CreateQuotationEndpoint( public override void Configure() { Post("/quotations"); - AllowAnonymous(); + Roles("Admin","Employe"); } public override async Task HandleAsync(CreateQuotationDto req, CancellationToken ct) diff --git a/PyroFetes/Endpoints/Quotations/DeleteProductFromQuotationEndpoint.cs b/PyroFetes/Endpoints/Quotations/DeleteProductFromQuotationEndpoint.cs index 569694e..a857879 100644 --- a/PyroFetes/Endpoints/Quotations/DeleteProductFromQuotationEndpoint.cs +++ b/PyroFetes/Endpoints/Quotations/DeleteProductFromQuotationEndpoint.cs @@ -16,7 +16,7 @@ public class DeleteProductFromQuotationEndpoint(QuotationProductsRepository quot public override void Configure() { Delete("/quotations/{@ProductId}/{@QuotationId}", x => new { x.ProductId, x.QuotationId }); - AllowAnonymous(); + Roles("Admin"); } public override async Task HandleAsync(DeleteQuotationProductRequest req, CancellationToken ct) diff --git a/PyroFetes/Endpoints/Quotations/DeleteQuotationEndpoint.cs b/PyroFetes/Endpoints/Quotations/DeleteQuotationEndpoint.cs index 737fa9e..e26b7ba 100644 --- a/PyroFetes/Endpoints/Quotations/DeleteQuotationEndpoint.cs +++ b/PyroFetes/Endpoints/Quotations/DeleteQuotationEndpoint.cs @@ -15,7 +15,8 @@ public class DeleteQuotationEndpoint(QuotationsRepository quotationsRepository) public override void Configure() { Delete("/quotations/{@Id}", x => new { x.Id }); - AllowAnonymous(); + Roles("Admin"); + } public override async Task HandleAsync(DeleteQuotationRequest req, CancellationToken ct) diff --git a/PyroFetes/Endpoints/Quotations/GetAllQuotationEndpoint.cs b/PyroFetes/Endpoints/Quotations/GetAllQuotationEndpoint.cs index bccafd3..d8a0f2d 100644 --- a/PyroFetes/Endpoints/Quotations/GetAllQuotationEndpoint.cs +++ b/PyroFetes/Endpoints/Quotations/GetAllQuotationEndpoint.cs @@ -10,7 +10,7 @@ public class GetAllQuotationEndpoint(QuotationsRepository quotationsRepository) public override void Configure() { Get("/quotations"); - AllowAnonymous(); + Roles("Admin","Employe"); } public override async Task HandleAsync(CancellationToken ct) diff --git a/PyroFetes/Endpoints/Quotations/GetQuotationEndpoint.cs b/PyroFetes/Endpoints/Quotations/GetQuotationEndpoint.cs index bc4b4fa..d22200e 100644 --- a/PyroFetes/Endpoints/Quotations/GetQuotationEndpoint.cs +++ b/PyroFetes/Endpoints/Quotations/GetQuotationEndpoint.cs @@ -18,7 +18,7 @@ public class GetQuotationEndpoint( public override void Configure() { Get("/quotations/{@Id}", x => new { x.Id }); - AllowAnonymous(); + Roles("Admin","Employe"); } public override async Task HandleAsync(GetQuotationRequest req, CancellationToken ct) diff --git a/PyroFetes/Endpoints/Quotations/GetQuotationPdfEndpoint.cs b/PyroFetes/Endpoints/Quotations/GetQuotationPdfEndpoint.cs index 434ddcf..4b015d9 100644 --- a/PyroFetes/Endpoints/Quotations/GetQuotationPdfEndpoint.cs +++ b/PyroFetes/Endpoints/Quotations/GetQuotationPdfEndpoint.cs @@ -17,7 +17,7 @@ public class GetQuotationPdfEndpoint( public override void Configure() { Get("/quotations/{@Id}/pdf", x => new { x.Id }); - AllowAnonymous(); + Roles("Admin","Employe"); Description(b => b.Produces(200, MediaTypeNames.Application.Pdf)); } diff --git a/PyroFetes/Endpoints/Quotations/PatchQuotationConditionsSaleEndpoint.cs b/PyroFetes/Endpoints/Quotations/PatchQuotationConditionsSaleEndpoint.cs index 203913f..827e2fb 100644 --- a/PyroFetes/Endpoints/Quotations/PatchQuotationConditionsSaleEndpoint.cs +++ b/PyroFetes/Endpoints/Quotations/PatchQuotationConditionsSaleEndpoint.cs @@ -14,7 +14,7 @@ public class PatchQuotationConditionsSaleEndpoint( public override void Configure() { Patch("/quotations/{@Id}/saleConditions", x => new { x.Id }); - AllowAnonymous(); + Roles("Admin","Employe"); } public override async Task HandleAsync(PatchQuotationConditionsSaleDto req, CancellationToken ct) diff --git a/PyroFetes/Endpoints/Quotations/PatchQuotationMessageEndpoint.cs b/PyroFetes/Endpoints/Quotations/PatchQuotationMessageEndpoint.cs index 066f831..542a54e 100644 --- a/PyroFetes/Endpoints/Quotations/PatchQuotationMessageEndpoint.cs +++ b/PyroFetes/Endpoints/Quotations/PatchQuotationMessageEndpoint.cs @@ -14,7 +14,7 @@ public class PatchQuotationMessageEndpoint( public override void Configure() { Patch("/quotations/{@Id}/message", x => new { x.Id }); - AllowAnonymous(); + Roles("Admin","Employe"); } public override async Task HandleAsync(PatchQuotationMessageDto req, CancellationToken ct) diff --git a/PyroFetes/Endpoints/Quotations/PatchQuotationProductQuantityEndpoint.cs b/PyroFetes/Endpoints/Quotations/PatchQuotationProductQuantityEndpoint.cs index f7cc233..1f1cff6 100644 --- a/PyroFetes/Endpoints/Quotations/PatchQuotationProductQuantityEndpoint.cs +++ b/PyroFetes/Endpoints/Quotations/PatchQuotationProductQuantityEndpoint.cs @@ -14,7 +14,7 @@ public class PatchQuotationProductQuantityEndpoint( public override void Configure() { Patch("/quotations/{@ProductId}/{@QuotationId}/Quantity", x => new { x.ProductId, x.QuotationId }); - AllowAnonymous(); + Roles("Admin","Employe"); } public override async Task HandleAsync(PatchQuotationProductQuantityDto req, CancellationToken ct) diff --git a/PyroFetes/Endpoints/Quotations/UpdateQuotationEndpoint.cs b/PyroFetes/Endpoints/Quotations/UpdateQuotationEndpoint.cs index 4284b5d..eb5b4a2 100644 --- a/PyroFetes/Endpoints/Quotations/UpdateQuotationEndpoint.cs +++ b/PyroFetes/Endpoints/Quotations/UpdateQuotationEndpoint.cs @@ -13,7 +13,8 @@ public class UpdateQuotationEndpoint( public override void Configure() { Put("/quotations/{@Id}", x => new { x.Id }); - AllowAnonymous(); + Roles("Admin","Employe"); + } public override async Task HandleAsync(UpdateQuotationDto req, CancellationToken ct) diff --git a/PyroFetes/Endpoints/Settings/GetSettingEndpoint.cs b/PyroFetes/Endpoints/Settings/GetSettingEndpoint.cs index e10ce01..fedd96c 100644 --- a/PyroFetes/Endpoints/Settings/GetSettingEndpoint.cs +++ b/PyroFetes/Endpoints/Settings/GetSettingEndpoint.cs @@ -10,7 +10,7 @@ public class GetSettingEndpoint(SettingsRepository settingsRepository, AutoMappe public override void Configure() { Get("/settings/"); - AllowAnonymous(); + Roles("Admin","Employe"); } public override async Task HandleAsync(CancellationToken ct) diff --git a/PyroFetes/Endpoints/Settings/PatchSettingElectronicSignatureEndpoint.cs b/PyroFetes/Endpoints/Settings/PatchSettingElectronicSignatureEndpoint.cs index efd1808..624f7d7 100644 --- a/PyroFetes/Endpoints/Settings/PatchSettingElectronicSignatureEndpoint.cs +++ b/PyroFetes/Endpoints/Settings/PatchSettingElectronicSignatureEndpoint.cs @@ -11,7 +11,8 @@ public class PatchSettingElectronicSignatureEndpoint(SettingsRepository settings { Patch("/settings/electronicSignature"); AllowFormData(); - AllowAnonymous(); + Roles("Admin"); + } public override async Task HandleAsync(PatchSettingElectronicSignatureDto req, CancellationToken ct) diff --git a/PyroFetes/Endpoints/Settings/PatchSettingLogoEndpoint.cs b/PyroFetes/Endpoints/Settings/PatchSettingLogoEndpoint.cs index 4047f19..d4a10d1 100644 --- a/PyroFetes/Endpoints/Settings/PatchSettingLogoEndpoint.cs +++ b/PyroFetes/Endpoints/Settings/PatchSettingLogoEndpoint.cs @@ -11,7 +11,7 @@ public class PatchSettingLogoEndpoint(SettingsRepository settingsRepository) : E { Patch("/settings/logo"); AllowFormData(); - AllowAnonymous(); + Roles("Admin"); } public override async Task HandleAsync(PatchSettingLogoDto req, CancellationToken ct) diff --git a/PyroFetes/Endpoints/Suppliers/AddProductToSupplierEndpoint.cs b/PyroFetes/Endpoints/Suppliers/AddProductToSupplierEndpoint.cs index 657ee98..90942e2 100644 --- a/PyroFetes/Endpoints/Suppliers/AddProductToSupplierEndpoint.cs +++ b/PyroFetes/Endpoints/Suppliers/AddProductToSupplierEndpoint.cs @@ -17,7 +17,7 @@ public class AddProductToSupplierEndpoint( public override void Configure() { Post("/suppliers/{@SupplierId}/{@ProductId}/", x => new { x.SupplierId, x.ProductId }); - AllowAnonymous(); + Roles("Admin","Employe"); } public override async Task HandleAsync(CreatePriceDto req, CancellationToken ct) diff --git a/PyroFetes/Endpoints/Suppliers/CreateSupplierEndpoint.cs b/PyroFetes/Endpoints/Suppliers/CreateSupplierEndpoint.cs index 6a137e6..fa63a16 100644 --- a/PyroFetes/Endpoints/Suppliers/CreateSupplierEndpoint.cs +++ b/PyroFetes/Endpoints/Suppliers/CreateSupplierEndpoint.cs @@ -10,7 +10,7 @@ public class CreateSupplierEndpoint(SuppliersRepository suppliersRepository, Aut public override void Configure() { Post("/suppliers"); - AllowAnonymous(); + Roles("Admin","Employe"); } public override async Task HandleAsync(CreateSupplierDto req, CancellationToken ct) diff --git a/PyroFetes/Endpoints/Suppliers/DeleteProductToSupplierEndpoint.cs b/PyroFetes/Endpoints/Suppliers/DeleteProductToSupplierEndpoint.cs index 8c2e514..8f70d79 100644 --- a/PyroFetes/Endpoints/Suppliers/DeleteProductToSupplierEndpoint.cs +++ b/PyroFetes/Endpoints/Suppliers/DeleteProductToSupplierEndpoint.cs @@ -16,7 +16,7 @@ public class DeleteProductToSupplierEndpoint(PricesRepository pricesRepository) public override void Configure() { Delete("/suppliers/{@SupplierId}/{@Product}", x => new { x.SupplierId, x.ProductId }); - AllowAnonymous(); + Roles("Admin"); } public override async Task HandleAsync(DeletePriceRequest req, CancellationToken ct) diff --git a/PyroFetes/Endpoints/Suppliers/DeleteSupplierEndpoint.cs b/PyroFetes/Endpoints/Suppliers/DeleteSupplierEndpoint.cs index 40f2655..163e42c 100644 --- a/PyroFetes/Endpoints/Suppliers/DeleteSupplierEndpoint.cs +++ b/PyroFetes/Endpoints/Suppliers/DeleteSupplierEndpoint.cs @@ -15,7 +15,7 @@ public class DeleteSupplierEndpoint(SuppliersRepository suppliersRepository) : E public override void Configure() { Delete("/suppliers/{@Id}", x => new { x.Id }); - AllowAnonymous(); + Roles("Admin"); } public override async Task HandleAsync(DeleteSupplierRequest req, CancellationToken ct) diff --git a/PyroFetes/Endpoints/Suppliers/GetAllSuppliersEndpoint.cs b/PyroFetes/Endpoints/Suppliers/GetAllSuppliersEndpoint.cs index 5a8bc28..faa0473 100644 --- a/PyroFetes/Endpoints/Suppliers/GetAllSuppliersEndpoint.cs +++ b/PyroFetes/Endpoints/Suppliers/GetAllSuppliersEndpoint.cs @@ -9,7 +9,7 @@ public class GetAllSuppliersEndpoint(SuppliersRepository suppliersRepository) : public override void Configure() { Get("/suppliers"); - AllowAnonymous(); + Roles("Admin","Employe"); } public override async Task HandleAsync(CancellationToken ct) diff --git a/PyroFetes/Endpoints/Suppliers/GetSupplierEndpoint.cs b/PyroFetes/Endpoints/Suppliers/GetSupplierEndpoint.cs index 29ba25a..258e720 100644 --- a/PyroFetes/Endpoints/Suppliers/GetSupplierEndpoint.cs +++ b/PyroFetes/Endpoints/Suppliers/GetSupplierEndpoint.cs @@ -16,7 +16,7 @@ public class GetSupplierEndpoint(SuppliersRepository suppliersRepository, AutoMa public override void Configure() { Get("/suppliers/{@Id}", x => new { x.Id }); - AllowAnonymous(); + Roles("Admin","Employe"); } public override async Task HandleAsync(GetSupplierRequest req, CancellationToken ct) diff --git a/PyroFetes/Endpoints/Suppliers/PatchPriceEndpoint.cs b/PyroFetes/Endpoints/Suppliers/PatchPriceEndpoint.cs index 38002f9..0b97a27 100644 --- a/PyroFetes/Endpoints/Suppliers/PatchPriceEndpoint.cs +++ b/PyroFetes/Endpoints/Suppliers/PatchPriceEndpoint.cs @@ -13,7 +13,7 @@ public class PatchPriceEndpoint( public override void Configure() { Patch("/prices/{@ProductId}/{@SupplierId}/SellingPrice", x => new { x.ProductId, x.SupplierId }); - AllowAnonymous(); + Roles("Admin","Employe"); } public override async Task HandleAsync(PatchPriceSellingPriceDto req, CancellationToken ct) diff --git a/PyroFetes/Endpoints/Suppliers/PatchSupplierDeliveryDelayEndpoint.cs b/PyroFetes/Endpoints/Suppliers/PatchSupplierDeliveryDelayEndpoint.cs index b058225..0f230b8 100644 --- a/PyroFetes/Endpoints/Suppliers/PatchSupplierDeliveryDelayEndpoint.cs +++ b/PyroFetes/Endpoints/Suppliers/PatchSupplierDeliveryDelayEndpoint.cs @@ -12,7 +12,8 @@ public class PatchSupplierDeliveryDelayEndpoint(SuppliersRepository suppliersRep public override void Configure() { Patch("/suppliers/{@Id}/deliveryDelay", x => new { x.Id }); - AllowAnonymous(); + Roles("Admin","Employe"); + } public override async Task HandleAsync(PatchSupplierDeliveryDelayDto req, CancellationToken ct) diff --git a/PyroFetes/Endpoints/Suppliers/UpdateSupplierEndpoint.cs b/PyroFetes/Endpoints/Suppliers/UpdateSupplierEndpoint.cs index d9f79f6..b55a8be 100644 --- a/PyroFetes/Endpoints/Suppliers/UpdateSupplierEndpoint.cs +++ b/PyroFetes/Endpoints/Suppliers/UpdateSupplierEndpoint.cs @@ -11,7 +11,7 @@ public class UpdateSupplierEndpoint(SuppliersRepository suppliersRepository, Aut public override void Configure() { Put("/suppliers/{@Id}", x => new { x.Id }); - AllowAnonymous(); + Roles("Admin","Employe"); } public override async Task HandleAsync(UpdateSupplierDto req, CancellationToken ct) diff --git a/PyroFetes/Endpoints/Users/CreateUserEndpoint.cs b/PyroFetes/Endpoints/Users/CreateUserEndpoint.cs index a4f183a..517536b 100644 --- a/PyroFetes/Endpoints/Users/CreateUserEndpoint.cs +++ b/PyroFetes/Endpoints/Users/CreateUserEndpoint.cs @@ -13,7 +13,7 @@ public class CreateUserEndpoint(UsersRepository usersRepository) : Endpoint new { x.Id }); - AllowAnonymous(); + Roles("Admin"); } public override async Task HandleAsync(DeleteUserRequest req, CancellationToken ct) diff --git a/PyroFetes/Endpoints/Users/GetAllUsersEndpoint.cs b/PyroFetes/Endpoints/Users/GetAllUsersEndpoint.cs index 46b5003..59731c3 100644 --- a/PyroFetes/Endpoints/Users/GetAllUsersEndpoint.cs +++ b/PyroFetes/Endpoints/Users/GetAllUsersEndpoint.cs @@ -9,7 +9,7 @@ public class GetAllUsersEndpoint(UsersRepository usersRepository) : EndpointWith public override void Configure() { Get("/users"); - AllowAnonymous(); + Roles("Admin"); } public override async Task HandleAsync(CancellationToken ct) diff --git a/PyroFetes/Endpoints/Users/GetUserEndpoint.cs b/PyroFetes/Endpoints/Users/GetUserEndpoint.cs index c6b5d45..de2c368 100644 --- a/PyroFetes/Endpoints/Users/GetUserEndpoint.cs +++ b/PyroFetes/Endpoints/Users/GetUserEndpoint.cs @@ -16,7 +16,7 @@ public class GetUserEndpoint(UsersRepository usersRepository, AutoMapper.IMapper public override void Configure() { Get("/users/{@Id}", x => new { x.Id }); - AllowAnonymous(); + Roles("Admin","Employe"); } public override async Task HandleAsync(GetUserRequest req, CancellationToken ct) diff --git a/PyroFetes/Endpoints/Users/PatchUserPasswordEndpoint.cs b/PyroFetes/Endpoints/Users/PatchUserPasswordEndpoint.cs index 760ce32..5095ca0 100644 --- a/PyroFetes/Endpoints/Users/PatchUserPasswordEndpoint.cs +++ b/PyroFetes/Endpoints/Users/PatchUserPasswordEndpoint.cs @@ -12,7 +12,7 @@ public class PatchUserPasswordEndpoint(UsersRepository usersRepository, AutoMapp public override void Configure() { Patch("/users/{@Id}/password", x => new { x.Id }); - AllowAnonymous(); + Roles("Admin"); } public override async Task HandleAsync(PatchUserPasswordDto req, CancellationToken ct) diff --git a/PyroFetes/Endpoints/Users/UpdateUserEndpoint.cs b/PyroFetes/Endpoints/Users/UpdateUserEndpoint.cs index ead9dbb..7d5ae39 100644 --- a/PyroFetes/Endpoints/Users/UpdateUserEndpoint.cs +++ b/PyroFetes/Endpoints/Users/UpdateUserEndpoint.cs @@ -13,7 +13,7 @@ public class UpdateUserEndpoint(UsersRepository usersRepository) : Endpoint new { x.Id }); - AllowAnonymous(); + Roles("Admin"); } public override async Task HandleAsync(UpdateUserDto req, CancellationToken ct) diff --git a/PyroFetes/Endpoints/WareHouse/GetAllWarehouseEndpoint.cs b/PyroFetes/Endpoints/WareHouse/GetAllWarehouseEndpoint.cs index 50bf272..4cef069 100644 --- a/PyroFetes/Endpoints/WareHouse/GetAllWarehouseEndpoint.cs +++ b/PyroFetes/Endpoints/WareHouse/GetAllWarehouseEndpoint.cs @@ -9,7 +9,7 @@ public class GetAllWarehouseEndpoint(WareHouseRepository wareHouseRepository, Au public override void Configure() { Get("/wareHouses/"); - AllowAnonymous(); + Roles("Admin","Employe"); } public override async Task HandleAsync(CancellationToken ct) diff --git a/PyroFetes/Endpoints/WareHouseProducts/GetTotalQuantityEndpoint.cs b/PyroFetes/Endpoints/WareHouseProducts/GetTotalQuantityEndpoint.cs index f24ae3e..473480f 100644 --- a/PyroFetes/Endpoints/WareHouseProducts/GetTotalQuantityEndpoint.cs +++ b/PyroFetes/Endpoints/WareHouseProducts/GetTotalQuantityEndpoint.cs @@ -16,7 +16,7 @@ public class GetTotalQuantityEndpoint( public override void Configure() { Get("/wareHouseProducts/{@ProductId}", x => new { x.ProductId }); - AllowAnonymous(); + Roles("Admin","Employe"); } public override async Task HandleAsync(GetTotalQuantityRequest req, CancellationToken ct) diff --git a/PyroFetes/Endpoints/WareHouseProducts/PatchWareHouseProductQuantityEndpoint.cs b/PyroFetes/Endpoints/WareHouseProducts/PatchWareHouseProductQuantityEndpoint.cs index 9e6733f..2e1246f 100644 --- a/PyroFetes/Endpoints/WareHouseProducts/PatchWareHouseProductQuantityEndpoint.cs +++ b/PyroFetes/Endpoints/WareHouseProducts/PatchWareHouseProductQuantityEndpoint.cs @@ -13,7 +13,7 @@ public class PatchWareHouseProductQuantityEndpoint(WarehouseProductsRepository w public override void Configure() { Patch("/wareHouseProducts/{@ProductId}/{@WareHouseId}/quantity", x => new { x.ProductId, x.WareHouseId }); - AllowAnonymous(); + Roles("Admin","Employe"); } public override async Task HandleAsync(PatchWareHouseProductQuantityDto req, CancellationToken ct) From 639631a63bb2e9f19a44abbd46ecf57f3a379df5 Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Thu, 28 May 2026 15:36:58 +0100 Subject: [PATCH 47/51] Changed Id value --- PyroFetes/Endpoints/Users/GetUserEndpoint.cs | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/PyroFetes/Endpoints/Users/GetUserEndpoint.cs b/PyroFetes/Endpoints/Users/GetUserEndpoint.cs index c6b5d45..e5f8d79 100644 --- a/PyroFetes/Endpoints/Users/GetUserEndpoint.cs +++ b/PyroFetes/Endpoints/Users/GetUserEndpoint.cs @@ -6,22 +6,18 @@ using PyroFetes.Specifications.Users; namespace PyroFetes.Endpoints.Users; -public class GetUserRequest -{ - public int Id { get; set; } -} - -public class GetUserEndpoint(UsersRepository usersRepository, AutoMapper.IMapper mapper) : Endpoint +public class GetUserEndpoint(UsersRepository usersRepository, AutoMapper.IMapper mapper) : EndpointWithoutRequest { public override void Configure() { - Get("/users/{@Id}", x => new { x.Id }); + Get("/user/"); AllowAnonymous(); } - public override async Task HandleAsync(GetUserRequest req, CancellationToken ct) + public override async Task HandleAsync(CancellationToken ct) { - User? user = await usersRepository.SingleOrDefaultAsync(new GetUserByIdSpec(req.Id), ct); + int userId = int.Parse(User.FindFirst("Id")!.Value); + User? user = await usersRepository.SingleOrDefaultAsync(new GetUserByIdSpec(userId), ct); if (user is null) { From 1bd92a87321c1fefbdcf15be6f45f7785c3bdfa1 Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Thu, 28 May 2026 15:39:55 +0100 Subject: [PATCH 48/51] Fix route error --- PyroFetes/Endpoints/Users/GetUserEndpoint.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PyroFetes/Endpoints/Users/GetUserEndpoint.cs b/PyroFetes/Endpoints/Users/GetUserEndpoint.cs index 22cb3ac..2a93a5e 100644 --- a/PyroFetes/Endpoints/Users/GetUserEndpoint.cs +++ b/PyroFetes/Endpoints/Users/GetUserEndpoint.cs @@ -10,7 +10,7 @@ public class GetUserEndpoint(UsersRepository usersRepository, AutoMapper.IMapper { public override void Configure() { - Get("/users/"); + Get("/user/"); Roles("Admin","Employe"); } From fb97729c719ffd69fee51078bd4dc2cd1ebae807 Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Thu, 28 May 2026 15:41:07 +0100 Subject: [PATCH 49/51] Changed values of userDto --- PyroFetes/DTO/User/Response/GetUserDto.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/PyroFetes/DTO/User/Response/GetUserDto.cs b/PyroFetes/DTO/User/Response/GetUserDto.cs index 1bbf572..b22d660 100644 --- a/PyroFetes/DTO/User/Response/GetUserDto.cs +++ b/PyroFetes/DTO/User/Response/GetUserDto.cs @@ -4,8 +4,6 @@ public class GetUserDto { public int Id { get; set; } public string? Name { get; set; } - public string? Password { get; set; } - public string? Salt { get; set; } public string? Fonction { get; set; } public string? Email { get; set; } } \ No newline at end of file From f0ad9b536a2b6e10858f7a3e38ae52fa8e71e9b8 Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Thu, 28 May 2026 15:50:57 +0100 Subject: [PATCH 50/51] Changed values of userDto --- PyroFetes/DTO/User/Response/GetUserDto.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/PyroFetes/DTO/User/Response/GetUserDto.cs b/PyroFetes/DTO/User/Response/GetUserDto.cs index b22d660..764e677 100644 --- a/PyroFetes/DTO/User/Response/GetUserDto.cs +++ b/PyroFetes/DTO/User/Response/GetUserDto.cs @@ -4,6 +4,7 @@ public class GetUserDto { public int Id { get; set; } public string? Name { get; set; } + public string? Password { get; set; } public string? Fonction { get; set; } public string? Email { get; set; } } \ No newline at end of file From 29759cf896dfb3284817d42713991b935c4aa18f Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Sat, 30 May 2026 13:44:21 +0100 Subject: [PATCH 51/51] Fixed wwwroot error --- PyroFetes/PyroFetes.csproj | 1 - PyroFetes/wwwroot/default.txt | 0 2 files changed, 1 deletion(-) create mode 100644 PyroFetes/wwwroot/default.txt diff --git a/PyroFetes/PyroFetes.csproj b/PyroFetes/PyroFetes.csproj index a492cc1..27aed3d 100644 --- a/PyroFetes/PyroFetes.csproj +++ b/PyroFetes/PyroFetes.csproj @@ -33,7 +33,6 @@ - diff --git a/PyroFetes/wwwroot/default.txt b/PyroFetes/wwwroot/default.txt new file mode 100644 index 0000000..e69de29