Compare commits
89 Commits
8416f5af82
...
feature/Cr
Author | SHA1 | Date | |
---|---|---|---|
ff590302e2 | |||
45f6baaac3 | |||
ef9740d8ff | |||
3ada21adae | |||
4f12911263 | |||
8bd7fadabc | |||
e4e6c1c3f7 | |||
791eff9256 | |||
b4502ae562 | |||
347003c24a | |||
31e69aae1a | |||
74b5fa6666 | |||
b79e07dd8b | |||
![]() |
3192d399cc | ||
![]() |
37f6460615 | ||
![]() |
ecd8883d55 | ||
![]() |
0209dbfc20 | ||
e773e201bd | |||
e336a50c4e | |||
e63be6e1f1 | |||
5a36c0ff2f | |||
014646d35c | |||
8371423b16 | |||
f7931fbed6 | |||
feb12b8c3b | |||
5ea5edaea6 | |||
aa65139b69 | |||
9be4fa67e6 | |||
e69ca1898d | |||
15526d1589 | |||
a27cb5cf2a | |||
ddbd662c2a | |||
464869e3ca | |||
25d1407bd2 | |||
a262fb094c | |||
f0ec7cd4d4 | |||
d0f20e08f0 | |||
b1d2d3d1a1 | |||
64fd223a63 | |||
59ddb9f7b2 | |||
2d42fa1017 | |||
b859e53f95 | |||
3cc96c4ebf | |||
6a813fc35a | |||
a93d399942 | |||
04cb47802b | |||
e4677b1aea | |||
268230daea | |||
ad9c8aa42d | |||
af208c152b | |||
0ddf5d380a | |||
af92cdc524 | |||
856d8e2733 | |||
89be35ecb0 | |||
9a5c83161a | |||
41b0f1892e | |||
2bbb771635 | |||
1446fe7b95 | |||
5261446ddb | |||
cfa2d59c0d | |||
fa353446eb | |||
f4da74e9e2 | |||
df3b820dea | |||
2d73830c5a | |||
5419ca5aa9 | |||
03db82ed49 | |||
65725922f6 | |||
c128cd453d | |||
52521908b7 | |||
3f1880b702 | |||
df919bf943 | |||
da0f5fb513 | |||
8be7169995 | |||
2781f1e80a | |||
c4e8b0b2de | |||
f163aa5feb | |||
4cb501fe04 | |||
87f92cf382 | |||
9da75d53b9 | |||
da468f2853 | |||
6bb86c0ce9 | |||
788ad93327 | |||
2bbb6c6e78 | |||
c0ee31f4a7 | |||
bb02df6323 | |||
21d3480b19 | |||
![]() |
964faa0b6b | ||
423f4c4a6c | |||
d3a8ae593e |
6
PyroFetes/DTO/Deliverer/Request/CreateDelivererDto.cs
Normal file
6
PyroFetes/DTO/Deliverer/Request/CreateDelivererDto.cs
Normal file
@@ -0,0 +1,6 @@
|
||||
namespace PyroFetes.DTO.Deliverer.Request;
|
||||
|
||||
public class CreateDelivererDto
|
||||
{
|
||||
public string? Transporter { get; set; }
|
||||
}
|
7
PyroFetes/DTO/Deliverer/Request/UpdateDelivererDto.cs
Normal file
7
PyroFetes/DTO/Deliverer/Request/UpdateDelivererDto.cs
Normal file
@@ -0,0 +1,7 @@
|
||||
namespace PyroFetes.DTO.Deliverer.Request;
|
||||
|
||||
public class UpdateDelivererDto
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string? Transporter { get; set; }
|
||||
}
|
11
PyroFetes/DTO/Deliverer/Response/GetDelivererDto.cs
Normal file
11
PyroFetes/DTO/Deliverer/Response/GetDelivererDto.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
using PyroFetes.DTO.DeliveryNote.Response;
|
||||
|
||||
namespace PyroFetes.DTO.Deliverer.Response;
|
||||
|
||||
public class GetDelivererDto
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string? Transporter { get; set; }
|
||||
|
||||
public List<GetDeliveryNoteDto>? DeliveryNotes { get; set; }
|
||||
}
|
11
PyroFetes/DTO/DeliveryNote/Request/CreateDeliveryNoteDto.cs
Normal file
11
PyroFetes/DTO/DeliveryNote/Request/CreateDeliveryNoteDto.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
namespace PyroFetes.DTO.DeliveryNote.Request;
|
||||
|
||||
public class CreateDeliveryNoteDto
|
||||
{
|
||||
public string? TrackingNumber { get; set; }
|
||||
public DateOnly EstimateDeliveryDate { get; set; }
|
||||
public DateOnly ExpeditionDate { get; set; }
|
||||
public DateOnly RealDeliveryDate { get; set; }
|
||||
|
||||
public int DelivererId { get; set; }
|
||||
}
|
@@ -0,0 +1,7 @@
|
||||
namespace PyroFetes.DTO.DeliveryNote.Request;
|
||||
|
||||
public class PatchDeliveryNoteRealDeliveryDateDto
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public DateOnly RealDeliveryDate { get; set; }
|
||||
}
|
12
PyroFetes/DTO/DeliveryNote/Request/UpdateDeliveryNoteDto.cs
Normal file
12
PyroFetes/DTO/DeliveryNote/Request/UpdateDeliveryNoteDto.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
namespace PyroFetes.DTO.DeliveryNote.Request;
|
||||
|
||||
public class UpdateDeliveryNoteDto
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string? TrackingNumber { get; set; }
|
||||
public DateOnly EstimateDeliveryDate { get; set; }
|
||||
public DateOnly ExpeditionDate { get; set; }
|
||||
public DateOnly? RealDeliveryDate { get; set; }
|
||||
|
||||
public int DelivererId { get; set; }
|
||||
}
|
17
PyroFetes/DTO/DeliveryNote/Response/GetDeliveryNoteDto.cs
Normal file
17
PyroFetes/DTO/DeliveryNote/Response/GetDeliveryNoteDto.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
using PyroFetes.DTO.ProductDelivery.Response;
|
||||
|
||||
namespace PyroFetes.DTO.DeliveryNote.Response;
|
||||
|
||||
public class GetDeliveryNoteDto
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string? TrackingNumber { get; set; }
|
||||
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<GetProductDeliveryDto>? Products { get; set; }
|
||||
}
|
27
PyroFetes/DTO/Price/Request/CreatePriceDto.cs
Normal file
27
PyroFetes/DTO/Price/Request/CreatePriceDto.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
namespace PyroFetes.DTO.Price.Request;
|
||||
|
||||
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 int SupplierZipCode { get; set; }
|
||||
public string? SupplierCity { get; set; }
|
||||
public int SupplierDeliveryDelay { get; set; }
|
||||
|
||||
public int ProductId { get; set; }
|
||||
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 decimal ProductWeight { get; set; }
|
||||
public decimal ProductNec { get; set; }
|
||||
public string? ProductImage { get; set; }
|
||||
public string? ProductLink { get; set; }
|
||||
public int ProductMinimalQuantity { get; set; }
|
||||
}
|
7
PyroFetes/DTO/Price/Request/PatchPriceSellingPriceDto.cs
Normal file
7
PyroFetes/DTO/Price/Request/PatchPriceSellingPriceDto.cs
Normal file
@@ -0,0 +1,7 @@
|
||||
namespace PyroFetes.DTO.Price.Request;
|
||||
|
||||
public class PatchPriceSellingPriceDto
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public decimal SellingPrice { get; set; }
|
||||
}
|
28
PyroFetes/DTO/Price/Request/UpdatePriceDto.cs
Normal file
28
PyroFetes/DTO/Price/Request/UpdatePriceDto.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
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 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 decimal ProductWeight { get; set; }
|
||||
public decimal ProductNec { get; set; }
|
||||
public string? ProductImage { get; set; }
|
||||
public string? ProductLink { get; set; }
|
||||
public int ProductMinimalQuantity { get; set; }
|
||||
}
|
28
PyroFetes/DTO/Price/Response/GetPriceDto.cs
Normal file
28
PyroFetes/DTO/Price/Response/GetPriceDto.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
namespace PyroFetes.DTO.Price.Response;
|
||||
|
||||
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 int SupplierZipCode { get; set; }
|
||||
public string? SupplierCity { get; set; }
|
||||
public int SupplierDeliveryDelay { get; set; }
|
||||
|
||||
public int ProductId { get; set; }
|
||||
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 decimal ProductWeight { get; set; }
|
||||
public decimal ProductNec { get; set; }
|
||||
public string? ProductImage { get; set; }
|
||||
public string? ProductLink { get; set; }
|
||||
public int ProductMinimalQuantity { get; set; }
|
||||
}
|
15
PyroFetes/DTO/Product/Request/CreateProductDto.cs
Normal file
15
PyroFetes/DTO/Product/Request/CreateProductDto.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
namespace PyroFetes.DTO.Product.Request;
|
||||
|
||||
public class CreateProductDto
|
||||
{
|
||||
public int References { get; set; }
|
||||
public string? Name { get; set; }
|
||||
public decimal Duration {get; set;}
|
||||
public decimal Caliber { get; set; }
|
||||
public int 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; }
|
||||
}
|
@@ -0,0 +1,7 @@
|
||||
namespace PyroFetes.DTO.Product.Request;
|
||||
|
||||
public class PatchProductMinimalStockDto
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public int MinimalQuantity { get; set; }
|
||||
}
|
16
PyroFetes/DTO/Product/Request/UpdateProductDto.cs
Normal file
16
PyroFetes/DTO/Product/Request/UpdateProductDto.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
namespace PyroFetes.DTO.Product.Request;
|
||||
|
||||
public class UpdateProductDto
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public int References { get; set; }
|
||||
public string? Name { get; set; }
|
||||
public decimal Duration {get; set;}
|
||||
public decimal Caliber { get; set; }
|
||||
public int 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; }
|
||||
}
|
16
PyroFetes/DTO/Product/Response/GetProductDto.cs
Normal file
16
PyroFetes/DTO/Product/Response/GetProductDto.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
namespace PyroFetes.DTO.Product.Response;
|
||||
|
||||
public class GetProductDto
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public int References { get; set; }
|
||||
public string? Name { get; set; }
|
||||
public decimal Duration {get; set;}
|
||||
public decimal Caliber { get; set; }
|
||||
public int 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; }
|
||||
}
|
@@ -0,0 +1,8 @@
|
||||
namespace PyroFetes.DTO.ProductDelivery.Request;
|
||||
|
||||
public class CreateProductDeliveryDto
|
||||
{
|
||||
public int ProductId { get; set; }
|
||||
public int DeliveryNoteId { get; set; }
|
||||
public int Quantity { get; set; }
|
||||
}
|
@@ -0,0 +1,8 @@
|
||||
namespace PyroFetes.DTO.ProductDelivery.Request;
|
||||
|
||||
public class UpdateProductDeliveryDto
|
||||
{
|
||||
public int Quantity { get; set; }
|
||||
public int ProductId { get; set; }
|
||||
public int DeliveryNoteId { get; set; }
|
||||
}
|
@@ -0,0 +1,28 @@
|
||||
namespace PyroFetes.DTO.ProductDelivery.Response;
|
||||
|
||||
public class GetProductDeliveryDto
|
||||
{
|
||||
public int ProductId { get; set; }
|
||||
public int ProductReference { 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; }
|
||||
|
||||
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; }
|
||||
}
|
@@ -0,0 +1,7 @@
|
||||
namespace PyroFetes.DTO.PurchaseOrder.Request;
|
||||
|
||||
public class PatchPurchaseOrderPurchaseConditionsDto
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string? PurchaseConditions { get; set; }
|
||||
}
|
10
PyroFetes/DTO/PurchaseOrder/Response/GetPurchaseOrderDto.cs
Normal file
10
PyroFetes/DTO/PurchaseOrder/Response/GetPurchaseOrderDto.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
using PyroFetes.DTO.PurchaseProduct.Response;
|
||||
|
||||
namespace PyroFetes.DTO.PurchaseOrder.Response;
|
||||
|
||||
public class GetPurchaseOrderDto
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string? PurchaseConditions { get; set; }
|
||||
public List<GetPurchaseProductDto>? GetPurchaseProductDto { get; set; }
|
||||
}
|
@@ -0,0 +1,9 @@
|
||||
namespace PyroFetes.DTO.PurchaseProduct.Request;
|
||||
|
||||
public class CreatePurchaseProductDto
|
||||
{
|
||||
public int Quantity { get; set; }
|
||||
public int ProductId { get; set; }
|
||||
public int PurchaseOrderId { get; set; }
|
||||
public string? PurchaseOrderPurchaseConditions { get; set; }
|
||||
}
|
@@ -0,0 +1,8 @@
|
||||
namespace PyroFetes.DTO.PurchaseProduct.Request;
|
||||
|
||||
public class PatchPurchaseProductQuantityDto
|
||||
{
|
||||
public int ProductId { get; set; }
|
||||
public int PurchaseOrderId { get; set; }
|
||||
public int Quantity { get; set; }
|
||||
}
|
@@ -0,0 +1,22 @@
|
||||
namespace PyroFetes.DTO.PurchaseProduct.Request;
|
||||
|
||||
public class UpdatePurchaseProductDto
|
||||
{
|
||||
public int ProductId { get; set; }
|
||||
public int PurchaseOrderId { get; set; }
|
||||
|
||||
public int Quantity { get; set; }
|
||||
|
||||
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 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; }
|
||||
}
|
@@ -0,0 +1,21 @@
|
||||
namespace PyroFetes.DTO.PurchaseProduct.Response;
|
||||
|
||||
public class GetPurchaseProductDto
|
||||
{
|
||||
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; }
|
||||
|
||||
public int PurchaseOrderId { get; set; }
|
||||
public string? PurchaseOrderPurchaseConditions { get; set; }
|
||||
|
||||
public int Quantity { get; set; }
|
||||
}
|
@@ -0,0 +1,7 @@
|
||||
namespace PyroFetes.DTO.Quotation.Request;
|
||||
|
||||
public class PatchQuotationConditionsSaleDto
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string? ConditionsSale { get; set; }
|
||||
}
|
@@ -0,0 +1,7 @@
|
||||
namespace PyroFetes.DTO.Quotation.Request;
|
||||
|
||||
public class PatchQuotationMessageDto
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string? Message { get; set; }
|
||||
}
|
11
PyroFetes/DTO/Quotation/Response/GetQuotationDto.cs
Normal file
11
PyroFetes/DTO/Quotation/Response/GetQuotationDto.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
using PyroFetes.DTO.QuotationProduct.Response;
|
||||
|
||||
namespace PyroFetes.DTO.Quotation.Response;
|
||||
|
||||
public class GetQuotationDto
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string? Message { get; set; }
|
||||
public string? ConditionsSale { get; set; }
|
||||
public List<GetQuotationProductDto>? GetQuotationProductDto { get; set; }
|
||||
}
|
@@ -0,0 +1,22 @@
|
||||
namespace PyroFetes.DTO.QuotationProduct.Request;
|
||||
|
||||
public class CreateQuotationProductDto
|
||||
{
|
||||
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 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; }
|
||||
}
|
@@ -0,0 +1,8 @@
|
||||
namespace PyroFetes.DTO.QuotationProduct.Request;
|
||||
|
||||
public class PatchQuotationProductQuantityDto
|
||||
{
|
||||
public int ProductId { get; set; }
|
||||
public int QuotationId { get; set; }
|
||||
public int Quantity { get; set; }
|
||||
}
|
@@ -0,0 +1,23 @@
|
||||
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 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; }
|
||||
}
|
@@ -0,0 +1,22 @@
|
||||
namespace PyroFetes.DTO.QuotationProduct.Response;
|
||||
|
||||
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? 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; }
|
||||
}
|
7
PyroFetes/DTO/SettingDTO/Request/CreateSettingDto.cs
Normal file
7
PyroFetes/DTO/SettingDTO/Request/CreateSettingDto.cs
Normal file
@@ -0,0 +1,7 @@
|
||||
namespace PyroFetes.DTO.SettingDTO.Request;
|
||||
|
||||
public class CreateSettingDto
|
||||
{
|
||||
public string? ElectronicSignature { get; set; }
|
||||
public string? Logo { get; set; }
|
||||
}
|
@@ -0,0 +1,7 @@
|
||||
namespace PyroFetes.DTO.SettingDTO.Request;
|
||||
|
||||
public class PatchSettingElectronicSignatureDto
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string? ElectronicSignature { get; set; }
|
||||
}
|
7
PyroFetes/DTO/SettingDTO/Request/PatchSettingLogoDto.cs
Normal file
7
PyroFetes/DTO/SettingDTO/Request/PatchSettingLogoDto.cs
Normal file
@@ -0,0 +1,7 @@
|
||||
namespace PyroFetes.DTO.SettingDTO.Request;
|
||||
|
||||
public class PatchSettingLogoDto
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string? Logo { get; set; }
|
||||
}
|
8
PyroFetes/DTO/SettingDTO/Response/GetSettingDto.cs
Normal file
8
PyroFetes/DTO/SettingDTO/Response/GetSettingDto.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
namespace PyroFetes.DTO.SettingDTO.Response;
|
||||
|
||||
public class GetSettingDto
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string? ElectronicSignature { get; set; }
|
||||
public string? Logo { get; set; }
|
||||
}
|
12
PyroFetes/DTO/Supplier/Request/CreateSupplierDto.cs
Normal file
12
PyroFetes/DTO/Supplier/Request/CreateSupplierDto.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
namespace PyroFetes.DTO.Supplier.Request;
|
||||
|
||||
public class CreateSupplierDto
|
||||
{
|
||||
public string? Name { get; set; }
|
||||
public string? Email { get; set; }
|
||||
public string? Phone { get; set; }
|
||||
public string? Address { get; set; }
|
||||
public int ZipCode { get; set; }
|
||||
public string? City { get; set; }
|
||||
public int DeliveryDelay { get; set; }
|
||||
}
|
@@ -0,0 +1,7 @@
|
||||
namespace PyroFetes.DTO.Supplier.Request;
|
||||
|
||||
public class PatchSupplierDeliveryDelayDto
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public int DeliveryDelay { get; set; }
|
||||
}
|
13
PyroFetes/DTO/Supplier/Request/UpdateSupplierDto.cs
Normal file
13
PyroFetes/DTO/Supplier/Request/UpdateSupplierDto.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
namespace PyroFetes.DTO.Supplier.Request;
|
||||
|
||||
public class UpdateSupplierDto
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string? Name { get; set; }
|
||||
public string? Email { get; set; }
|
||||
public string? Phone { get; set; }
|
||||
public string? Address { get; set; }
|
||||
public int ZipCode { get; set; }
|
||||
public string? City { get; set; }
|
||||
public int DeliveryDelay { get; set; }
|
||||
}
|
13
PyroFetes/DTO/Supplier/Response/GetSupplierDto.cs
Normal file
13
PyroFetes/DTO/Supplier/Response/GetSupplierDto.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
namespace PyroFetes.DTO.Supplier.Response;
|
||||
|
||||
public class GetSupplierDto
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string? Name { get; set; }
|
||||
public string? Email { get; set; }
|
||||
public string? Phone { get; set; }
|
||||
public string? Address { get; set; }
|
||||
public int ZipCode { get; set; }
|
||||
public string? City { get; set; }
|
||||
public int DeliveryDelay { get; set; }
|
||||
}
|
10
PyroFetes/DTO/User/Request/CreateUserDto.cs
Normal file
10
PyroFetes/DTO/User/Request/CreateUserDto.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
namespace PyroFetes.DTO.User.Request;
|
||||
|
||||
public class CreateUserDto
|
||||
{
|
||||
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; }
|
||||
}
|
7
PyroFetes/DTO/User/Request/PatchUserPasswordDto.cs
Normal file
7
PyroFetes/DTO/User/Request/PatchUserPasswordDto.cs
Normal file
@@ -0,0 +1,7 @@
|
||||
namespace PyroFetes.DTO.User.Request;
|
||||
|
||||
public class PatchUserPasswordDto
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string? Password { get; set; }
|
||||
}
|
10
PyroFetes/DTO/User/Request/UpdateUserDto.cs
Normal file
10
PyroFetes/DTO/User/Request/UpdateUserDto.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
namespace PyroFetes.DTO.User.Request;
|
||||
|
||||
public class UpdateUserDto
|
||||
{
|
||||
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; }
|
||||
}
|
11
PyroFetes/DTO/User/Response/GetUserDto.cs
Normal file
11
PyroFetes/DTO/User/Response/GetUserDto.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
namespace PyroFetes.DTO.User.Response;
|
||||
|
||||
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; }
|
||||
}
|
@@ -0,0 +1,27 @@
|
||||
namespace PyroFetes.DTO.WareHouseProduct.Request;
|
||||
|
||||
public class CreateWareHouseProductDto
|
||||
{
|
||||
public int Quantity { get; set; }
|
||||
|
||||
public int WareHouseId { get; set; }
|
||||
public string? WareHouseName {get; set;}
|
||||
public int WareHouseMaxWeight {get; set;}
|
||||
public int WareHouseCurrent {get; set;}
|
||||
public int WareHouseMinWeight {get; set;}
|
||||
public string? WareHouseAddress { get; set; }
|
||||
public int WareHouseZipCode { get; set; }
|
||||
public string? WareHouseCity { get; set; }
|
||||
|
||||
public int ProductId { get; set; }
|
||||
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 decimal ProductWeight { get; set; }
|
||||
public decimal ProductNec { get; set; }
|
||||
public string? ProductImage { get; set; }
|
||||
public string? ProductLink { get; set; }
|
||||
public int ProductMinimalQuantity { get; set; }
|
||||
}
|
@@ -0,0 +1,7 @@
|
||||
namespace PyroFetes.DTO.WareHouseProduct.Request;
|
||||
|
||||
public class PatchWareHouseProductQuantityDto
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public int Quantity { get; set; }
|
||||
}
|
@@ -0,0 +1,28 @@
|
||||
namespace PyroFetes.DTO.WareHouseProduct.Request;
|
||||
|
||||
public class UpdateWareHouseProductDto
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public int Quantity { get; set; }
|
||||
|
||||
public int WareHouseId { get; set; }
|
||||
public string? WareHouseName {get; set;}
|
||||
public int WareHouseMaxWeight {get; set;}
|
||||
public int WareHouseCurrent {get; set;}
|
||||
public int WareHouseMinWeight {get; set;}
|
||||
public string? WareHouseAddress { get; set; }
|
||||
public int WareHouseZipCode { get; set; }
|
||||
public string? WareHouseCity { get; set; }
|
||||
|
||||
public int ProductId { get; set; }
|
||||
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 decimal ProductWeight { get; set; }
|
||||
public decimal ProductNec { get; set; }
|
||||
public string? ProductImage { get; set; }
|
||||
public string? ProductLink { get; set; }
|
||||
public int ProductMinimalQuantity { get; set; }
|
||||
}
|
@@ -0,0 +1,28 @@
|
||||
namespace PyroFetes.DTO.WareHouseProduct.Response;
|
||||
|
||||
public class GetWareHouseProductDto
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public int Quantity { get; set; }
|
||||
|
||||
public int WareHouseId { get; set; }
|
||||
public string? WareHouseName {get; set;}
|
||||
public int WareHouseMaxWeight {get; set;}
|
||||
public int WareHouseCurrent {get; set;}
|
||||
public int WareHouseMinWeight {get; set;}
|
||||
public string? WareHouseAddress { get; set; }
|
||||
public int WareHouseZipCode { get; set; }
|
||||
public string? WareHouseCity { get; set; }
|
||||
|
||||
public int ProductId { get; set; }
|
||||
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 decimal ProductWeight { get; set; }
|
||||
public decimal ProductNec { get; set; }
|
||||
public string? ProductImage { get; set; }
|
||||
public string? ProductLink { get; set; }
|
||||
public int ProductMinimalQuantity { get; set; }
|
||||
}
|
@@ -0,0 +1,41 @@
|
||||
using FastEndpoints;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace PyroFetes.Endpoints.PurchaseOrder;
|
||||
|
||||
public class DeletePurchaseOrderRequest
|
||||
{
|
||||
public int Id { get; set; }
|
||||
}
|
||||
|
||||
public class DeletePurchaseOrderEndpoint(PyroFetesDbContext database) : Endpoint<DeletePurchaseOrderRequest>
|
||||
{
|
||||
public override void Configure()
|
||||
{
|
||||
Delete("/api/purchaseOrders/{Id}", x => new {x.Id});
|
||||
AllowAnonymous();
|
||||
}
|
||||
|
||||
public override async Task HandleAsync(DeletePurchaseOrderRequest req, CancellationToken ct)
|
||||
{
|
||||
var purchaseOrder = await database.PurchaseOrders
|
||||
.Include(po => po.PurchaseProducts)
|
||||
.SingleOrDefaultAsync(po => po.Id == req.Id, ct);
|
||||
|
||||
if (purchaseOrder == null)
|
||||
{
|
||||
await Send.NotFoundAsync(ct);
|
||||
return;
|
||||
}
|
||||
|
||||
if (purchaseOrder.PurchaseProducts != null && purchaseOrder.PurchaseProducts.Any())
|
||||
{
|
||||
database.PurchaseProducts.RemoveRange(purchaseOrder.PurchaseProducts);
|
||||
}
|
||||
|
||||
database.PurchaseOrders.Remove(purchaseOrder);
|
||||
await database.SaveChangesAsync(ct);
|
||||
|
||||
await Send.NoContentAsync(ct);
|
||||
}
|
||||
}
|
@@ -0,0 +1,45 @@
|
||||
using FastEndpoints;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using PyroFetes.DTO.PurchaseOrder.Response;
|
||||
using PyroFetes.DTO.PurchaseProduct.Response;
|
||||
|
||||
namespace PyroFetes.Endpoints.PurchaseOrder;
|
||||
|
||||
public class GetAllPurchaseOrderEndpoint(PyroFetesDbContext database) : EndpointWithoutRequest<List<GetPurchaseOrderDto>>
|
||||
{
|
||||
public override void Configure()
|
||||
{
|
||||
Get("/api/purchaseOrders");
|
||||
}
|
||||
|
||||
public override async Task HandleAsync(CancellationToken ct)
|
||||
{
|
||||
var purchaseOrder = await database.PurchaseOrders
|
||||
.Include(p => p.PurchaseProducts)
|
||||
.Select(purchaseOrder => new GetPurchaseOrderDto()
|
||||
{
|
||||
Id = purchaseOrder.Id,
|
||||
PurchaseConditions = purchaseOrder.PurchaseConditions,
|
||||
GetPurchaseProductDto = purchaseOrder.PurchaseProducts
|
||||
.Select(p => new GetPurchaseProductDto
|
||||
{
|
||||
ProductId = p.ProductId,
|
||||
ProductReferences = p.Product.Reference,
|
||||
ProductName = p.Product.Name,
|
||||
ProductDuration = p.Product.Duration,
|
||||
ProductCaliber = p.Product.Caliber,
|
||||
ProductApprovalNumber = p.Product.ApprovalNumber,
|
||||
ProductWeight = p.Product.Weight,
|
||||
ProductNec = p.Product.Nec,
|
||||
ProductImage = p.Product.Image,
|
||||
ProductLink = p.Product.Link,
|
||||
ProductMinimalQuantity = p.Product.MinimalQuantity,
|
||||
PurchaseOrderId = p.PurchaseOrderId,
|
||||
Quantity = p.Quantity,
|
||||
}).ToList()
|
||||
})
|
||||
.ToListAsync(ct);
|
||||
|
||||
await Send.OkAsync(purchaseOrder, ct);
|
||||
}
|
||||
}
|
@@ -0,0 +1,56 @@
|
||||
using FastEndpoints;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using PyroFetes.DTO.PurchaseOrder.Response;
|
||||
using PyroFetes.DTO.PurchaseProduct.Response;
|
||||
|
||||
namespace PyroFetes.Endpoints.PurchaseOrder;
|
||||
|
||||
public class GetPurchaseOrderRequest
|
||||
{
|
||||
public int Id { get; set; }
|
||||
}
|
||||
|
||||
public class GetPurchaseOrderEndpoint(PyroFetesDbContext database) : Endpoint<GetPurchaseOrderRequest, GetPurchaseOrderDto>
|
||||
{
|
||||
public override void Configure()
|
||||
{
|
||||
Get("/api/purchaseOrders/{@Id}", x => new {x.Id});
|
||||
}
|
||||
|
||||
public override async Task HandleAsync(GetPurchaseOrderRequest req, CancellationToken ct)
|
||||
{
|
||||
var purchaseOrder = await database.PurchaseOrders
|
||||
.SingleOrDefaultAsync(x => x.Id == req.Id, ct);
|
||||
|
||||
if (purchaseOrder == null)
|
||||
{
|
||||
await Send.NotFoundAsync(ct);
|
||||
return;
|
||||
}
|
||||
|
||||
GetPurchaseOrderDto responseDto = new()
|
||||
{
|
||||
Id = purchaseOrder.Id,
|
||||
PurchaseConditions = purchaseOrder.PurchaseConditions,
|
||||
GetPurchaseProductDto = purchaseOrder.PurchaseProducts
|
||||
.Select(p => new GetPurchaseProductDto
|
||||
{
|
||||
ProductId = p.ProductId,
|
||||
ProductReferences = p.Product.Reference,
|
||||
ProductName = p.Product.Name,
|
||||
ProductDuration = p.Product.Duration,
|
||||
ProductCaliber = p.Product.Caliber,
|
||||
ProductApprovalNumber = p.Product.ApprovalNumber,
|
||||
ProductWeight = p.Product.Weight,
|
||||
ProductNec = p.Product.Nec,
|
||||
ProductImage = p.Product.Image,
|
||||
ProductLink = p.Product.Link,
|
||||
ProductMinimalQuantity = p.Product.MinimalQuantity,
|
||||
PurchaseOrderId = p.PurchaseOrderId,
|
||||
Quantity = p.Quantity,
|
||||
}).ToList()
|
||||
};
|
||||
|
||||
await Send.OkAsync(responseDto, ct);
|
||||
}
|
||||
}
|
@@ -0,0 +1,54 @@
|
||||
using FastEndpoints;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using PyroFetes.DTO.PurchaseOrder.Request;
|
||||
using PyroFetes.DTO.PurchaseOrder.Response;
|
||||
using PyroFetes.DTO.PurchaseProduct.Request;
|
||||
using PyroFetes.DTO.PurchaseProduct.Response;
|
||||
|
||||
namespace PyroFetes.Endpoints.PurchaseOrder;
|
||||
|
||||
public class PatchPurchaseOrderPurchaseConditionsEndpoint(PyroFetesDbContext database) : Endpoint<PatchPurchaseOrderPurchaseConditionsDto, GetPurchaseOrderDto>
|
||||
{
|
||||
public override void Configure()
|
||||
{
|
||||
Patch("/api/purchaseOrders/{Id}/PurchaseConditions", x => new { x.Id });
|
||||
AllowAnonymous();
|
||||
}
|
||||
|
||||
public override async Task HandleAsync(PatchPurchaseOrderPurchaseConditionsDto req, CancellationToken ct)
|
||||
{
|
||||
var purchaseOrder = await database.PurchaseOrders.SingleOrDefaultAsync(po => po.Id == req.Id, ct);
|
||||
if (purchaseOrder == null)
|
||||
{
|
||||
await Send.NotFoundAsync(ct);
|
||||
return;
|
||||
}
|
||||
|
||||
purchaseOrder.PurchaseConditions = req.PurchaseConditions;
|
||||
await database.SaveChangesAsync(ct);
|
||||
|
||||
GetPurchaseOrderDto responseDto = new()
|
||||
{
|
||||
Id = purchaseOrder.Id,
|
||||
PurchaseConditions = purchaseOrder.PurchaseConditions,
|
||||
GetPurchaseProductDto = purchaseOrder.PurchaseProducts
|
||||
.Select(p => new GetPurchaseProductDto
|
||||
{
|
||||
ProductId = p.ProductId,
|
||||
ProductReferences = p.Product.Reference,
|
||||
ProductName = p.Product.Name,
|
||||
ProductDuration = p.Product.Duration,
|
||||
ProductCaliber = p.Product.Caliber,
|
||||
ProductApprovalNumber = p.Product.ApprovalNumber,
|
||||
ProductWeight = p.Product.Weight,
|
||||
ProductNec = p.Product.Nec,
|
||||
ProductImage = p.Product.Image,
|
||||
ProductLink = p.Product.Link,
|
||||
ProductMinimalQuantity = p.Product.MinimalQuantity,
|
||||
PurchaseOrderId = p.PurchaseOrderId,
|
||||
Quantity = p.Quantity,
|
||||
}).ToList()
|
||||
};
|
||||
await Send.OkAsync(responseDto, ct);
|
||||
}
|
||||
}
|
@@ -0,0 +1,67 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using FastEndpoints;
|
||||
using PyroFetes.DTO.PurchaseProduct.Request;
|
||||
using PyroFetes.DTO.PurchaseProduct.Response;
|
||||
|
||||
namespace PyroFetes.Endpoints.PurchaseProduct;
|
||||
|
||||
public class CreatePurchaseProductEndpoint(PyroFetesDbContext database) : Endpoint<CreatePurchaseProductDto, GetPurchaseProductDto>
|
||||
{
|
||||
public override void Configure()
|
||||
{
|
||||
Post("/api/purchaseProducts");
|
||||
AllowAnonymous();
|
||||
}
|
||||
|
||||
public override async Task HandleAsync(CreatePurchaseProductDto req, CancellationToken ct)
|
||||
{
|
||||
var product = await database.Products.FirstOrDefaultAsync(p => p.Id == req.ProductId, ct);
|
||||
if (product == null)
|
||||
{
|
||||
await Send.NotFoundAsync(ct);
|
||||
return;
|
||||
}
|
||||
|
||||
var purchaseOrder = await database.PurchaseOrders.FirstOrDefaultAsync(po => po.Id == req.PurchaseOrderId, ct);
|
||||
|
||||
if (purchaseOrder == null)
|
||||
{
|
||||
purchaseOrder = new Models.PurchaseOrder()
|
||||
{
|
||||
PurchaseConditions = req.PurchaseOrderPurchaseConditions ?? "Conditions non précisées"
|
||||
};
|
||||
database.PurchaseOrders.Add(purchaseOrder);
|
||||
await database.SaveChangesAsync(ct);
|
||||
}
|
||||
|
||||
var purchaseProduct = new Models.PurchaseProduct()
|
||||
{
|
||||
ProductId = product.Id,
|
||||
PurchaseOrderId = purchaseOrder.Id,
|
||||
Quantity = req.Quantity
|
||||
};
|
||||
database.PurchaseProducts.Add(purchaseProduct);
|
||||
await database.SaveChangesAsync(ct);
|
||||
|
||||
var responseDto = new GetPurchaseProductDto()
|
||||
{
|
||||
ProductId = product.Id,
|
||||
ProductReferences = product.Reference,
|
||||
ProductName = product.Name,
|
||||
ProductDuration = product.Duration,
|
||||
ProductCaliber = product.Caliber,
|
||||
ProductApprovalNumber = product.ApprovalNumber,
|
||||
ProductWeight = product.Weight,
|
||||
ProductNec = product.Nec,
|
||||
ProductImage = product.Image,
|
||||
ProductLink = product.Link,
|
||||
ProductMinimalQuantity = product.MinimalQuantity,
|
||||
|
||||
PurchaseOrderId = purchaseOrder.Id,
|
||||
PurchaseOrderPurchaseConditions = purchaseOrder.PurchaseConditions,
|
||||
Quantity = purchaseProduct.Quantity
|
||||
};
|
||||
|
||||
await Send.OkAsync(responseDto, ct);
|
||||
}
|
||||
}
|
@@ -0,0 +1,36 @@
|
||||
using FastEndpoints;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace PyroFetes.Endpoints.PurchaseProduct;
|
||||
|
||||
public class DeletePurchaseProductRequest
|
||||
{
|
||||
public int ProductId { get; set; }
|
||||
public int PurchaseOrderId { get; set; }
|
||||
}
|
||||
|
||||
public class DeletePurchaseOrderEndpoint(PyroFetesDbContext database) : Endpoint<DeletePurchaseProductRequest>
|
||||
{
|
||||
public override void Configure()
|
||||
{
|
||||
Delete("/api/purchaseProducts/{ProductId}/{PurchaseOrderId}", x => new {x.ProductId, x.PurchaseOrderId});
|
||||
AllowAnonymous();
|
||||
}
|
||||
|
||||
public override async Task HandleAsync(DeletePurchaseProductRequest req, CancellationToken ct)
|
||||
{
|
||||
var purchaseProduct = await database.PurchaseProducts
|
||||
.SingleOrDefaultAsync(po => po.ProductId == req.ProductId && po.PurchaseOrderId == req.PurchaseOrderId, ct);
|
||||
|
||||
if (purchaseProduct == null)
|
||||
{
|
||||
await Send.NotFoundAsync(ct);
|
||||
return;
|
||||
}
|
||||
|
||||
database.PurchaseProducts.Remove(purchaseProduct);
|
||||
await database.SaveChangesAsync(ct);
|
||||
|
||||
await Send.NoContentAsync(ct);
|
||||
}
|
||||
}
|
@@ -0,0 +1,36 @@
|
||||
using FastEndpoints;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using PyroFetes.DTO.PurchaseProduct.Request;
|
||||
using PyroFetes.DTO.PurchaseProduct.Response;
|
||||
|
||||
namespace PyroFetes.Endpoints.PurchaseProduct;
|
||||
|
||||
public class PatchPurchaseProductQuantityEndpoint(PyroFetesDbContext database) : Endpoint<PatchPurchaseProductQuantityDto, GetPurchaseProductDto>
|
||||
{
|
||||
public override void Configure()
|
||||
{
|
||||
Patch("/api/purchaseProducts/{ProductId}/{PurchaseOrderId}/Quantity", x => new { x.ProductId, x.PurchaseOrderId });
|
||||
AllowAnonymous();
|
||||
}
|
||||
|
||||
public override async Task HandleAsync(PatchPurchaseProductQuantityDto req, CancellationToken ct)
|
||||
{
|
||||
var purchaseProduct = await database.PurchaseProducts.SingleOrDefaultAsync(po => po.ProductId == req.ProductId && po.PurchaseOrderId == req.PurchaseOrderId, ct);
|
||||
if (purchaseProduct == null)
|
||||
{
|
||||
await Send.NotFoundAsync(ct);
|
||||
return;
|
||||
}
|
||||
|
||||
purchaseProduct.Quantity = req.Quantity;
|
||||
await database.SaveChangesAsync(ct);
|
||||
|
||||
GetPurchaseProductDto responseDto = new()
|
||||
{
|
||||
ProductId = purchaseProduct.ProductId,
|
||||
PurchaseOrderId = purchaseProduct.PurchaseOrderId,
|
||||
Quantity = purchaseProduct.Quantity
|
||||
};
|
||||
await Send.OkAsync(responseDto, ct);
|
||||
}
|
||||
}
|
@@ -0,0 +1,70 @@
|
||||
using FastEndpoints;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using PyroFetes.DTO.PurchaseProduct.Request;
|
||||
using PyroFetes.DTO.PurchaseProduct.Response;
|
||||
using PyroFetes.DTO.QuotationProduct.Request;
|
||||
using PyroFetes.DTO.QuotationProduct.Response;
|
||||
|
||||
namespace PyroFetes.Endpoints.QuoationProduct;
|
||||
|
||||
public class CreateQuotationProductEndpoint(PyroFetesDbContext database) : Endpoint<CreateQuotationProductDto, GetQuotationProductDto>
|
||||
{
|
||||
public override void Configure()
|
||||
{
|
||||
Post("/api/quotationProduct");
|
||||
AllowAnonymous();
|
||||
}
|
||||
|
||||
public override async Task HandleAsync(CreateQuotationProductDto req, CancellationToken ct)
|
||||
{
|
||||
var product = await database.Products.FirstOrDefaultAsync(p => p.Id == req.ProductId, ct);
|
||||
if (product == null)
|
||||
{
|
||||
await Send.NotFoundAsync(ct);
|
||||
return;
|
||||
}
|
||||
|
||||
var quotation = await database.Quotations.FirstOrDefaultAsync(q => q.Id == req.QuotationId, ct);
|
||||
|
||||
if (quotation == null)
|
||||
{
|
||||
quotation = new Models.Quotation()
|
||||
{
|
||||
Message = req.QuotationMessage ?? "",
|
||||
ConditionsSale = req.QuotationConditionsSale,
|
||||
};
|
||||
database.Quotations.Add(quotation);
|
||||
await database.SaveChangesAsync(ct);
|
||||
}
|
||||
|
||||
var quotationProduct = new Models.QuotationProduct()
|
||||
{
|
||||
ProductId = product.Id,
|
||||
QuotationId = quotation.Id,
|
||||
Quantity = req.Quantity
|
||||
};
|
||||
database.QuotationProducts.Add(quotationProduct);
|
||||
await database.SaveChangesAsync(ct);
|
||||
|
||||
var responseDto = new GetQuotationProductDto()
|
||||
{
|
||||
ProductId = product.Id,
|
||||
ProductReferences = product.Reference,
|
||||
ProductName = product.Name,
|
||||
ProductDuration = product.Duration,
|
||||
ProductCaliber = product.Caliber,
|
||||
ProductApprovalNumber = product.ApprovalNumber,
|
||||
ProductWeight = product.Weight,
|
||||
ProductNec = product.Nec,
|
||||
ProductImage = product.Image,
|
||||
ProductLink = product.Link,
|
||||
ProductMinimalQuantity = product.MinimalQuantity,
|
||||
Quantity = quotationProduct.Quantity,
|
||||
QuotationMessage = quotation.Message,
|
||||
QuotationConditionsSale = quotation.ConditionsSale,
|
||||
QuotationId = quotation.Id,
|
||||
};
|
||||
|
||||
await Send.OkAsync(responseDto, ct);
|
||||
}
|
||||
}
|
@@ -0,0 +1,36 @@
|
||||
using FastEndpoints;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace PyroFetes.Endpoints.QuoationProduct;
|
||||
|
||||
public class DeleteQuotationProductRequest
|
||||
{
|
||||
public int ProductId { get; set; }
|
||||
public int QuotationId { get; set; }
|
||||
}
|
||||
|
||||
public class DeleteQuotationProductEndpoint(PyroFetesDbContext database) : Endpoint<DeleteQuotationProductRequest>
|
||||
{
|
||||
public override void Configure()
|
||||
{
|
||||
Delete("/api/quotationProduct/{ProductId}/{QuotationId}", x => new {x.ProductId, x.QuotationId});
|
||||
AllowAnonymous();
|
||||
}
|
||||
|
||||
public override async Task HandleAsync(DeleteQuotationProductRequest req, CancellationToken ct)
|
||||
{
|
||||
var quotationProduct = await database.QuotationProducts
|
||||
.SingleOrDefaultAsync(qo => qo.ProductId == req.ProductId && qo.QuotationId == req.QuotationId, ct);
|
||||
|
||||
if (quotationProduct == null)
|
||||
{
|
||||
await Send.NotFoundAsync(ct);
|
||||
return;
|
||||
}
|
||||
|
||||
database.QuotationProducts.Remove(quotationProduct);
|
||||
await database.SaveChangesAsync(ct);
|
||||
|
||||
await Send.NoContentAsync(ct);
|
||||
}
|
||||
}
|
@@ -0,0 +1,36 @@
|
||||
using FastEndpoints;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using PyroFetes.DTO.QuotationProduct.Request;
|
||||
using PyroFetes.DTO.QuotationProduct.Response;
|
||||
|
||||
namespace PyroFetes.Endpoints.QuoationProduct;
|
||||
|
||||
public class PatchQuotationProductQuantityEndpoint(PyroFetesDbContext database) : Endpoint<PatchQuotationProductQuantityDto, GetQuotationProductDto>
|
||||
{
|
||||
public override void Configure()
|
||||
{
|
||||
Patch("/api/quotationProduct/{ProductId}/{QuotationId}/Quantity", x => new { x.ProductId, x.QuotationId });
|
||||
AllowAnonymous();
|
||||
}
|
||||
|
||||
public override async Task HandleAsync(PatchQuotationProductQuantityDto req, CancellationToken ct)
|
||||
{
|
||||
var quotationProduct = await database.QuotationProducts.SingleOrDefaultAsync(qo => qo.ProductId == req.ProductId && qo.QuotationId == req.QuotationId, ct);
|
||||
if (quotationProduct == null)
|
||||
{
|
||||
await Send.NotFoundAsync(ct);
|
||||
return;
|
||||
}
|
||||
|
||||
quotationProduct.Quantity = req.Quantity;
|
||||
await database.SaveChangesAsync(ct);
|
||||
|
||||
GetQuotationProductDto responseDto = new()
|
||||
{
|
||||
ProductId = quotationProduct.ProductId,
|
||||
QuotationId = quotationProduct.QuotationId,
|
||||
Quantity = quotationProduct.Quantity
|
||||
};
|
||||
await Send.OkAsync(responseDto, ct);
|
||||
}
|
||||
}
|
41
PyroFetes/Endpoints/Quotation/DeleteQuotationEndpoint.cs
Normal file
41
PyroFetes/Endpoints/Quotation/DeleteQuotationEndpoint.cs
Normal file
@@ -0,0 +1,41 @@
|
||||
using FastEndpoints;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace PyroFetes.Endpoints.Quotation;
|
||||
|
||||
public class DeleteQuotationRequest
|
||||
{
|
||||
public int Id { get; set; }
|
||||
}
|
||||
|
||||
public class DeleteQuotationEndpoint(PyroFetesDbContext database) : Endpoint<DeleteQuotationRequest>
|
||||
{
|
||||
public override void Configure()
|
||||
{
|
||||
Delete("/api/quotations/{Id}", x => new {x.Id});
|
||||
AllowAnonymous();
|
||||
}
|
||||
|
||||
public override async Task HandleAsync(DeleteQuotationRequest req, CancellationToken ct)
|
||||
{
|
||||
var quotation = await database.Quotations
|
||||
.Include(q => q.QuotationProducts)
|
||||
.SingleOrDefaultAsync(q => q.Id == req.Id, ct);
|
||||
|
||||
if (quotation == null)
|
||||
{
|
||||
await Send.NotFoundAsync(ct);
|
||||
return;
|
||||
}
|
||||
|
||||
if (quotation.QuotationProducts != null && quotation.QuotationProducts.Any())
|
||||
{
|
||||
database.QuotationProducts.RemoveRange(quotation.QuotationProducts);
|
||||
}
|
||||
|
||||
database.Quotations.Remove(quotation);
|
||||
await database.SaveChangesAsync(ct);
|
||||
|
||||
await Send.NoContentAsync(ct);
|
||||
}
|
||||
}
|
48
PyroFetes/Endpoints/Quotation/GetAllQuotationEndpoint.cs
Normal file
48
PyroFetes/Endpoints/Quotation/GetAllQuotationEndpoint.cs
Normal file
@@ -0,0 +1,48 @@
|
||||
using FastEndpoints;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using PyroFetes.DTO.Quotation.Response;
|
||||
using PyroFetes.DTO.QuotationProduct.Response;
|
||||
|
||||
namespace PyroFetes.Endpoints.Quotation;
|
||||
|
||||
public class GetAllQuotationEndpoint(PyroFetesDbContext database) : EndpointWithoutRequest<List<GetQuotationDto>>
|
||||
{
|
||||
public override void Configure()
|
||||
{
|
||||
Get("/api/quotations");
|
||||
}
|
||||
|
||||
public override async Task HandleAsync(CancellationToken ct)
|
||||
{
|
||||
var quotations = await database.Quotations
|
||||
.Include(q => q.QuotationProducts!)
|
||||
.ThenInclude(qp => qp.Product)
|
||||
.Select(q => new GetQuotationDto
|
||||
{
|
||||
Id = q.Id,
|
||||
Message = q.Message,
|
||||
ConditionsSale = q.ConditionsSale,
|
||||
GetQuotationProductDto = q.QuotationProducts.Select(qp => new GetQuotationProductDto
|
||||
{
|
||||
Quantity = qp.Quantity,
|
||||
QuotationId = q.Id,
|
||||
QuotationMessage = q.Message,
|
||||
QuotationConditionsSale = q.ConditionsSale,
|
||||
ProductId = qp.ProductId,
|
||||
ProductReferences = qp.Product.Reference,
|
||||
ProductName = qp.Product.Name,
|
||||
ProductDuration = qp.Product.Duration,
|
||||
ProductCaliber = qp.Product.Caliber,
|
||||
ProductApprovalNumber = qp.Product.ApprovalNumber,
|
||||
ProductWeight = qp.Product.Weight,
|
||||
ProductNec = qp.Product.Nec,
|
||||
ProductImage = qp.Product.Image,
|
||||
ProductLink = qp.Product.Link,
|
||||
ProductMinimalQuantity = qp.Product.MinimalQuantity,
|
||||
}).ToList()
|
||||
})
|
||||
.ToListAsync(ct);
|
||||
|
||||
await Send.OkAsync(quotations, ct);
|
||||
}
|
||||
}
|
59
PyroFetes/Endpoints/Quotation/GetQuotationEndpoint.cs
Normal file
59
PyroFetes/Endpoints/Quotation/GetQuotationEndpoint.cs
Normal file
@@ -0,0 +1,59 @@
|
||||
using FastEndpoints;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using PyroFetes.DTO.Quotation.Response;
|
||||
using PyroFetes.DTO.QuotationProduct.Response;
|
||||
|
||||
namespace PyroFetes.Endpoints.Quotation;
|
||||
|
||||
public class GetQuotationRequest
|
||||
{
|
||||
public int Id { get; set; }
|
||||
}
|
||||
|
||||
public class GetQuotationEndpoint(PyroFetesDbContext database) : Endpoint<GetQuotationRequest, GetQuotationDto>
|
||||
{
|
||||
public override void Configure()
|
||||
{
|
||||
Get("/api/quotations/{@Id}", x => new {x.Id});
|
||||
}
|
||||
|
||||
public override async Task HandleAsync(GetQuotationRequest req, CancellationToken ct)
|
||||
{
|
||||
var quotation = await database.Quotations
|
||||
.SingleOrDefaultAsync(x => x.Id == req.Id, ct);
|
||||
|
||||
if (quotation == null)
|
||||
{
|
||||
await Send.NotFoundAsync(ct);
|
||||
return;
|
||||
}
|
||||
|
||||
GetQuotationDto responseDto = new()
|
||||
{
|
||||
Id = quotation.Id,
|
||||
Message = quotation.Message,
|
||||
ConditionsSale = quotation.ConditionsSale,
|
||||
GetQuotationProductDto = quotation.QuotationProducts
|
||||
.Select(qp => new GetQuotationProductDto
|
||||
{
|
||||
Quantity = qp.Quantity,
|
||||
QuotationId = quotation.Id,
|
||||
QuotationMessage = quotation.Message,
|
||||
QuotationConditionsSale = quotation.ConditionsSale,
|
||||
ProductId = qp.ProductId,
|
||||
ProductReferences = qp.Product.Reference,
|
||||
ProductName = qp.Product.Name,
|
||||
ProductDuration = qp.Product.Duration,
|
||||
ProductCaliber = qp.Product.Caliber,
|
||||
ProductApprovalNumber = qp.Product.ApprovalNumber,
|
||||
ProductWeight = qp.Product.Weight,
|
||||
ProductNec = qp.Product.Nec,
|
||||
ProductImage = qp.Product.Image,
|
||||
ProductLink = qp.Product.Link,
|
||||
ProductMinimalQuantity = qp.Product.MinimalQuantity,
|
||||
}).ToList()
|
||||
};
|
||||
|
||||
await Send.OkAsync(responseDto, ct);
|
||||
}
|
||||
}
|
@@ -0,0 +1,58 @@
|
||||
using FastEndpoints;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using PyroFetes.DTO.PurchaseOrder.Request;
|
||||
using PyroFetes.DTO.PurchaseOrder.Response;
|
||||
using PyroFetes.DTO.PurchaseProduct.Response;
|
||||
using PyroFetes.DTO.Quotation.Request;
|
||||
using PyroFetes.DTO.Quotation.Response;
|
||||
using PyroFetes.DTO.QuotationProduct.Response;
|
||||
|
||||
namespace PyroFetes.Endpoints.Quotation;
|
||||
|
||||
public class PatchQuotationConditionsSaleEndpoint(PyroFetesDbContext database) : Endpoint<PatchQuotationConditionsSaleDto, GetQuotationDto>
|
||||
{
|
||||
public override void Configure()
|
||||
{
|
||||
Patch("/api/quotations/{Id}/ConditionsSale", x => new { x.Id });
|
||||
AllowAnonymous();
|
||||
}
|
||||
|
||||
public override async Task HandleAsync(PatchQuotationConditionsSaleDto req, CancellationToken ct)
|
||||
{
|
||||
var quotation = await database.Quotations.SingleOrDefaultAsync(x => x.Id == req.Id, ct);
|
||||
if (quotation == null)
|
||||
{
|
||||
await Send.NotFoundAsync(ct);
|
||||
return;
|
||||
}
|
||||
|
||||
quotation.ConditionsSale = req.ConditionsSale;
|
||||
await database.SaveChangesAsync(ct);
|
||||
|
||||
GetQuotationDto responseDto = new()
|
||||
{
|
||||
Id = quotation.Id,
|
||||
Message = quotation.Message,
|
||||
ConditionsSale = quotation.ConditionsSale,
|
||||
GetQuotationProductDto = quotation.QuotationProducts.Select(qp => new GetQuotationProductDto
|
||||
{
|
||||
Quantity = qp.Quantity,
|
||||
QuotationId = quotation.Id,
|
||||
QuotationMessage = quotation.Message,
|
||||
QuotationConditionsSale = quotation.ConditionsSale,
|
||||
ProductId = qp.ProductId,
|
||||
ProductReferences = qp.Product.Reference,
|
||||
ProductName = qp.Product.Name,
|
||||
ProductDuration = qp.Product.Duration,
|
||||
ProductCaliber = qp.Product.Caliber,
|
||||
ProductApprovalNumber = qp.Product.ApprovalNumber,
|
||||
ProductWeight = qp.Product.Weight,
|
||||
ProductNec = qp.Product.Nec,
|
||||
ProductImage = qp.Product.Image,
|
||||
ProductLink = qp.Product.Link,
|
||||
ProductMinimalQuantity = qp.Product.MinimalQuantity,
|
||||
}).ToList()
|
||||
};
|
||||
await Send.OkAsync(responseDto, ct);
|
||||
}
|
||||
}
|
32
PyroFetes/Endpoints/Setting/CreateSettingEndpoint.cs
Normal file
32
PyroFetes/Endpoints/Setting/CreateSettingEndpoint.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
using PyroFetes.DTO.SettingDTO.Request;
|
||||
using PyroFetes.DTO.SettingDTO.Response;
|
||||
using FastEndpoints;
|
||||
namespace PyroFetes.Endpoints.Setting;
|
||||
|
||||
public class CreateSettingEndpoint(PyroFetesDbContext database) : Endpoint<CreateSettingDto, GetSettingDto>
|
||||
{
|
||||
public override void Configure()
|
||||
{
|
||||
Post("/api/setting");
|
||||
}
|
||||
|
||||
public override async Task HandleAsync(CreateSettingDto req, CancellationToken ct)
|
||||
{
|
||||
var setting = new Models.Setting()
|
||||
{
|
||||
ElectronicSignature = req.ElectronicSignature,
|
||||
Logo = req.Logo
|
||||
};
|
||||
|
||||
database.Settings.Add(setting);
|
||||
await database.SaveChangesAsync(ct);
|
||||
|
||||
GetSettingDto responseDto = new()
|
||||
{
|
||||
Id = setting.Id,
|
||||
ElectronicSignature = setting.ElectronicSignature,
|
||||
Logo = setting.Logo
|
||||
};
|
||||
await Send.OkAsync(responseDto, ct);
|
||||
}
|
||||
}
|
33
PyroFetes/Endpoints/Setting/DeleteSettingEndpoint.cs
Normal file
33
PyroFetes/Endpoints/Setting/DeleteSettingEndpoint.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using FastEndpoints;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace PyroFetes.Endpoints.Setting;
|
||||
|
||||
public class DeleteSettingRequest
|
||||
{
|
||||
public int Id { get; set; }
|
||||
}
|
||||
|
||||
public class DeleteSettingEndpoint(PyroFetesDbContext database) : Endpoint<DeleteSettingRequest>
|
||||
{
|
||||
public override void Configure()
|
||||
{
|
||||
Delete("/api/setting/{@Id}", x => new {x.Id});
|
||||
}
|
||||
|
||||
public override async Task HandleAsync(DeleteSettingRequest req, CancellationToken ct)
|
||||
{
|
||||
var setting = await database.Settings.SingleOrDefaultAsync(x => x.Id == req.Id, ct);
|
||||
|
||||
if (setting == null)
|
||||
{
|
||||
await Send.NotFoundAsync(ct);
|
||||
return;
|
||||
}
|
||||
|
||||
database.Settings.Remove(setting);
|
||||
await database.SaveChangesAsync(ct);
|
||||
|
||||
await Send.NoContentAsync(ct);
|
||||
}
|
||||
}
|
38
PyroFetes/Endpoints/Setting/GetSettingEndpoint.cs
Normal file
38
PyroFetes/Endpoints/Setting/GetSettingEndpoint.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using FastEndpoints;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using PyroFetes.DTO.SettingDTO.Response;
|
||||
|
||||
namespace PyroFetes.Endpoints.Setting;
|
||||
|
||||
public class GetSettingRequest
|
||||
{
|
||||
public int Id { get; set; }
|
||||
}
|
||||
|
||||
public class GetSettingEndpoint(PyroFetesDbContext database) : Endpoint<GetSettingRequest, GetSettingDto>
|
||||
{
|
||||
public override void Configure()
|
||||
{
|
||||
Get("/api/setting/{@Id}", x => new {x.Id});
|
||||
}
|
||||
|
||||
public override async Task HandleAsync(GetSettingRequest req, CancellationToken ct)
|
||||
{
|
||||
var setting = await database.Settings
|
||||
.SingleOrDefaultAsync(x => x.Id == req.Id, ct);
|
||||
|
||||
if (setting == null)
|
||||
{
|
||||
await Send.NotFoundAsync(ct);
|
||||
return;
|
||||
}
|
||||
|
||||
GetSettingDto responseDto = new()
|
||||
{
|
||||
Id = setting.Id,
|
||||
ElectronicSignature = setting.ElectronicSignature,
|
||||
Logo = setting.Logo
|
||||
};
|
||||
await Send.OkAsync(responseDto, ct);
|
||||
}
|
||||
}
|
@@ -0,0 +1,37 @@
|
||||
using FastEndpoints;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using PyroFetes.DTO.SettingDTO.Request;
|
||||
using PyroFetes.DTO.SettingDTO.Response;
|
||||
|
||||
namespace PyroFetes.Endpoints.Setting;
|
||||
|
||||
public class PatchSettingElectronicSignatureEndpoint(PyroFetesDbContext database) : Endpoint<PatchSettingElectronicSignatureDto, GetSettingDto>
|
||||
{
|
||||
public override void Configure()
|
||||
{
|
||||
Get("/api/setting/{@Id}/ElectronicSignature", x => new {x.Id});
|
||||
}
|
||||
|
||||
public override async Task HandleAsync(PatchSettingElectronicSignatureDto req, CancellationToken ct)
|
||||
{
|
||||
var setting = await database.Settings.SingleOrDefaultAsync(x => x.Id == req.Id, ct);
|
||||
|
||||
if (setting == null)
|
||||
{
|
||||
await Send.NotFoundAsync(ct);
|
||||
return;
|
||||
}
|
||||
|
||||
setting.ElectronicSignature = req.ElectronicSignature;
|
||||
await database.SaveChangesAsync(ct);
|
||||
|
||||
GetSettingDto responseDto = new()
|
||||
{
|
||||
Id = setting.Id,
|
||||
ElectronicSignature = setting.ElectronicSignature,
|
||||
Logo = setting.Logo
|
||||
};
|
||||
|
||||
await Send.OkAsync(responseDto, ct);
|
||||
}
|
||||
}
|
37
PyroFetes/Endpoints/Setting/PatchSettingLogoEndpoint.cs
Normal file
37
PyroFetes/Endpoints/Setting/PatchSettingLogoEndpoint.cs
Normal file
@@ -0,0 +1,37 @@
|
||||
using FastEndpoints;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using PyroFetes.DTO.SettingDTO.Request;
|
||||
using PyroFetes.DTO.SettingDTO.Response;
|
||||
|
||||
namespace PyroFetes.Endpoints.Setting;
|
||||
|
||||
public class PatchSettingLogoEndpoint(PyroFetesDbContext database) : Endpoint<PatchSettingLogoDto, GetSettingDto>
|
||||
{
|
||||
public override void Configure()
|
||||
{
|
||||
Get("/api/setting/{@Id}/Logo", x => new {x.Id});
|
||||
}
|
||||
|
||||
public override async Task HandleAsync(PatchSettingLogoDto req, CancellationToken ct)
|
||||
{
|
||||
var setting = await database.Settings.SingleOrDefaultAsync(x => x.Id == req.Id, ct);
|
||||
|
||||
if (setting == null)
|
||||
{
|
||||
await Send.NotFoundAsync(ct);
|
||||
return;
|
||||
}
|
||||
|
||||
setting.Logo = req.Logo;
|
||||
await database.SaveChangesAsync(ct);
|
||||
|
||||
GetSettingDto responseDto = new()
|
||||
{
|
||||
Id = setting.Id,
|
||||
ElectronicSignature = setting.ElectronicSignature,
|
||||
Logo = setting.Logo
|
||||
};
|
||||
|
||||
await Send.OkAsync(responseDto, ct);
|
||||
}
|
||||
}
|
1951
PyroFetes/Migrations/20251008103414_InitialDatabase.Designer.cs
generated
Normal file
1951
PyroFetes/Migrations/20251008103414_InitialDatabase.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
1392
PyroFetes/Migrations/20251008103414_InitialDatabase.cs
Normal file
1392
PyroFetes/Migrations/20251008103414_InitialDatabase.cs
Normal file
File diff suppressed because it is too large
Load Diff
1950
PyroFetes/Migrations/20251010083620_FixingDatabase.Designer.cs
generated
Normal file
1950
PyroFetes/Migrations/20251010083620_FixingDatabase.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
52
PyroFetes/Migrations/20251010083620_FixingDatabase.cs
Normal file
52
PyroFetes/Migrations/20251010083620_FixingDatabase.cs
Normal file
@@ -0,0 +1,52 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace PyroFetes.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class FixingDatabase : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "References",
|
||||
table: "Products");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "SellingPrice",
|
||||
table: "Products");
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "Reference",
|
||||
table: "Products",
|
||||
type: "nvarchar(20)",
|
||||
maxLength: 20,
|
||||
nullable: false,
|
||||
defaultValue: "");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Reference",
|
||||
table: "Products");
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "References",
|
||||
table: "Products",
|
||||
type: "int",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
|
||||
migrationBuilder.AddColumn<decimal>(
|
||||
name: "SellingPrice",
|
||||
table: "Products",
|
||||
type: "decimal(18,2)",
|
||||
nullable: false,
|
||||
defaultValue: 0m);
|
||||
}
|
||||
}
|
||||
}
|
1963
PyroFetes/Migrations/20251013175653_AddingEntitiesInDatabase.Designer.cs
generated
Normal file
1963
PyroFetes/Migrations/20251013175653_AddingEntitiesInDatabase.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
755
PyroFetes/Migrations/20251013175653_AddingEntitiesInDatabase.cs
Normal file
755
PyroFetes/Migrations/20251013175653_AddingEntitiesInDatabase.cs
Normal file
@@ -0,0 +1,755 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace PyroFetes.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AddingEntitiesInDatabase : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
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<int>(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);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
1960
PyroFetes/Migrations/PyroFetesDbContextModelSnapshot.cs
Normal file
1960
PyroFetes/Migrations/PyroFetesDbContextModelSnapshot.cs
Normal file
File diff suppressed because it is too large
Load Diff
13
PyroFetes/Models/.idea/.gitignore
generated
vendored
Normal file
13
PyroFetes/Models/.idea/.gitignore
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
# Rider ignored files
|
||||
/.idea.Models.iml
|
||||
/modules.xml
|
||||
/contentModel.xml
|
||||
/projectSettingsUpdater.xml
|
||||
# Editor-based HTTP Client requests
|
||||
/httpRequests/
|
||||
# Datasource local storage ignored files
|
||||
/dataSources/
|
||||
/dataSources.local.xml
|
4
PyroFetes/Models/.idea/encodings.xml
generated
Normal file
4
PyroFetes/Models/.idea/encodings.xml
generated
Normal file
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="Encoding" addBOMForNewFiles="with BOM under Windows, with no BOM otherwise" />
|
||||
</project>
|
8
PyroFetes/Models/.idea/indexLayout.xml
generated
Normal file
8
PyroFetes/Models/.idea/indexLayout.xml
generated
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="UserContentModel">
|
||||
<attachedFolders />
|
||||
<explicitIncludes />
|
||||
<explicitExcludes />
|
||||
</component>
|
||||
</project>
|
14
PyroFetes/Models/Availability.cs
Normal file
14
PyroFetes/Models/Availability.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace PyroFetes.Models;
|
||||
|
||||
public class Availability
|
||||
{
|
||||
[Key] public int Id { get; set; }
|
||||
[Required] public DateOnly AvailabilityDate { get; set; }
|
||||
[Required] public DateOnly DeliveryDate { get; set; }
|
||||
[Required] public DateOnly ExpirationDate { get; set; }
|
||||
[Required] public DateOnly RenewallDate { get; set; }
|
||||
|
||||
public List<StaffAvailability>? StaffAvailabilities { get; set; }
|
||||
}
|
12
PyroFetes/Models/Brand.cs
Normal file
12
PyroFetes/Models/Brand.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace PyroFetes.Models;
|
||||
|
||||
public class Brand
|
||||
{
|
||||
[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; }
|
||||
}
|
12
PyroFetes/Models/City.cs
Normal file
12
PyroFetes/Models/City.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace PyroFetes.Models;
|
||||
|
||||
public class City
|
||||
{
|
||||
[Key] public int Id { get; set; }
|
||||
[Required, MaxLength(100)] public string? Name { get; set; }
|
||||
[Required] public int ZipCode { get; set; }
|
||||
|
||||
public List<Show>? Shows { get; set; }
|
||||
}
|
11
PyroFetes/Models/Classification.cs
Normal file
11
PyroFetes/Models/Classification.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace PyroFetes.Models;
|
||||
|
||||
public class Classification
|
||||
{
|
||||
[Key] public int Id { get; set; }
|
||||
[Required, MaxLength(100)] public string? Label { get; set; }
|
||||
|
||||
public List<Product>? Products { get; set; }
|
||||
}
|
11
PyroFetes/Models/Color.cs
Normal file
11
PyroFetes/Models/Color.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace PyroFetes.Models;
|
||||
|
||||
public class Color
|
||||
{
|
||||
[Key] public int Id { get; set; }
|
||||
[Required, MaxLength(100)] public string? Label { get; set; }
|
||||
|
||||
public List<ProductColor>? ProductColors { get; set; }
|
||||
}
|
14
PyroFetes/Models/Communication.cs
Normal file
14
PyroFetes/Models/Communication.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace PyroFetes.Models;
|
||||
|
||||
public class Communication
|
||||
{
|
||||
[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; }
|
||||
}
|
23
PyroFetes/Models/Contact.cs
Normal file
23
PyroFetes/Models/Contact.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace PyroFetes.Models;
|
||||
|
||||
public class Contact
|
||||
{
|
||||
[Key] public int Id { get; set; }
|
||||
[Required, MaxLength(100)] public string? LastName { get; set; }
|
||||
[Required, MaxLength(100)] public string? FirstName { get; set; }
|
||||
[Required, MaxLength(100)] public string? Email { get; set; }
|
||||
[Required, MaxLength(30)] public string? PhoneNumber { get; set; }
|
||||
[Required, MaxLength(100)] public string? Address { get; set; }
|
||||
[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<Communication>? Communications { get; set; }
|
||||
public List<StaffContact>? StaffContacts { get; set; }
|
||||
public List<ContactServiceProvider>? ContactServiceProviders { get; set; }
|
||||
}
|
14
PyroFetes/Models/ContactServiceProvider.cs
Normal file
14
PyroFetes/Models/ContactServiceProvider.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace PyroFetes.Models;
|
||||
|
||||
[PrimaryKey(nameof(ContactId), nameof(ServiceProviderId))]
|
||||
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; }
|
||||
}
|
15
PyroFetes/Models/Contract.cs
Normal file
15
PyroFetes/Models/Contract.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace PyroFetes.Models;
|
||||
|
||||
[PrimaryKey(nameof(ShowId), nameof(ServiceProviderId))]
|
||||
public class Contract
|
||||
{
|
||||
[Required] public int ShowId { get; set; }
|
||||
[Required] public int ServiceProviderId { get; set; }
|
||||
[Required] public string? TermsAndConditions { get; set; }
|
||||
|
||||
public Show? Show { get; set; }
|
||||
public ServiceProvider? ServiceProvider { get; set; }
|
||||
}
|
16
PyroFetes/Models/Customer.cs
Normal file
16
PyroFetes/Models/Customer.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace PyroFetes.Models;
|
||||
|
||||
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<Contact>? Contacts { get; set; }
|
||||
public List<Quotation>? Quotations { get; set; }
|
||||
}
|
11
PyroFetes/Models/CustomerType.cs
Normal file
11
PyroFetes/Models/CustomerType.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace PyroFetes.Models;
|
||||
|
||||
public class CustomerType
|
||||
{
|
||||
[Key] public int Id { get; set; }
|
||||
[Required, MaxLength(100)] public string? Label { get; set; }
|
||||
|
||||
public List<Customer>? Customers { get; set; }
|
||||
}
|
@@ -5,7 +5,7 @@ namespace PyroFetes.Models;
|
||||
public class Deliverer
|
||||
{
|
||||
[Key] public int Id { get; set; }
|
||||
[Required] public string? Transporter { get; set; }
|
||||
[Required, MaxLength(100)] public string? Transporter { get; set; }
|
||||
|
||||
public List<DeliveryNote>? DeliveryNotes { get; set; }
|
||||
}
|
@@ -5,11 +5,12 @@ namespace PyroFetes.Models;
|
||||
public class DeliveryNote
|
||||
{
|
||||
[Key] public int Id { get; set; }
|
||||
[Required] public string? TrackingNumber { get; set; }
|
||||
[Required, MaxLength(100)] public string? TrackingNumber { get; set; }
|
||||
public int DelivererId { get; set; }
|
||||
[Required] public DateOnly EstimateDeliveryDate { get; set; }
|
||||
[Required] public DateOnly ExpeditionDate { get; set; }
|
||||
[Required] public DateOnly RealDeliveryDate { get; set; }
|
||||
|
||||
public Deliverer? Deliverer { get; set; }
|
||||
public List<ProductDelivery>? ProductDeliveries { get; set; }
|
||||
}
|
11
PyroFetes/Models/Effect.cs
Normal file
11
PyroFetes/Models/Effect.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace PyroFetes.Models;
|
||||
|
||||
public class Effect
|
||||
{
|
||||
[Key] public int Id { get; set; }
|
||||
[Required, MaxLength(200)] public string? Label { get; set; }
|
||||
|
||||
public List<ProductEffect>? ProductEffects { get; set; }
|
||||
}
|
12
PyroFetes/Models/ExperienceLevel.cs
Normal file
12
PyroFetes/Models/ExperienceLevel.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace PyroFetes.Models;
|
||||
|
||||
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; }
|
||||
}
|
12
PyroFetes/Models/HistoryOfApproval.cs
Normal file
12
PyroFetes/Models/HistoryOfApproval.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace PyroFetes.Models;
|
||||
|
||||
public class HistoryOfApproval
|
||||
{
|
||||
[Key] public int Id { get; set; }
|
||||
[Required] public DateOnly DeliveryDate { get; set; }
|
||||
[Required] public DateOnly ExpirationDate { get; set; }
|
||||
|
||||
public List<StaffHistoryOfApproval>? StaffHistoryOfApprovals { get; set; }
|
||||
}
|
16
PyroFetes/Models/Material.cs
Normal file
16
PyroFetes/Models/Material.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
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<ShowMaterial>? ShowMaterials {get; set;}
|
||||
public List<MaterialWarehouse>? MaterialWarehouses {get; set;}
|
||||
}
|
14
PyroFetes/Models/MaterialWarehouse.cs
Normal file
14
PyroFetes/Models/MaterialWarehouse.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace PyroFetes.Models;
|
||||
|
||||
[PrimaryKey(nameof(MaterialId), nameof(WarehouseId))]
|
||||
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; }
|
||||
}
|
19
PyroFetes/Models/Movement.cs
Normal file
19
PyroFetes/Models/Movement.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
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;}
|
||||
|
||||
public List<Product>? Products { get; set; }
|
||||
|
||||
public int? SourceWarehouseId {get; set;}
|
||||
public Warehouse? SourceWarehouse {get; set;}
|
||||
public int? DestinationWarehouseId {get; set;}
|
||||
public Warehouse? DestinationWarehouse {get; set;}
|
||||
}
|
@@ -1,4 +1,5 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Runtime.CompilerServices;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace PyroFetes.Models;
|
||||
|
@@ -1,8 +1,41 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace PyroFetes.Models;
|
||||
|
||||
public class Product
|
||||
namespace PyroFetes.Models
|
||||
{
|
||||
[Key] public int Id { get; set; }
|
||||
public class Product
|
||||
{
|
||||
[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 Caliber { get; set; }
|
||||
[Required] public int ApprovalNumber { get; set; }
|
||||
[Required] public decimal Weight { get; set; }
|
||||
[Required] public decimal Nec { get; set; }
|
||||
[Required] public string? Image { get; set; }
|
||||
[Required, MaxLength(200)] public string? Link { get; set; }
|
||||
[Required] public int MinimalQuantity { get; set; }
|
||||
|
||||
// Relations
|
||||
[Required] public int ClassificationId { get; set; }
|
||||
public Classification? Classification { get; set; }
|
||||
|
||||
[Required] public int ProductCategoryId { get; set; }
|
||||
public ProductCategory? ProductCategory { get; set; }
|
||||
|
||||
[Required] public int MovementId {get; set;}
|
||||
public Movement? Movement {get; set;}
|
||||
|
||||
public List<ProductDelivery>? ProductDeliveries { get; set; }
|
||||
public List<Brand>? Brands { get; set; }
|
||||
public List<ProductEffect>? ProductEffects { get; set; }
|
||||
public List<ProductColor>? ProductColors { get; set; }
|
||||
public List<PurchaseProduct>? PurchaseProducts { get; set; }
|
||||
public List<Price>? Prices { get; set; }
|
||||
public List<QuotationProduct>? QuotationProducts { get; set; }
|
||||
public List<WarehouseProduct>? WarehouseProducts { get; set; }
|
||||
public List<ProductTimecode>? ProductTimecodes { get; set; }
|
||||
|
||||
|
||||
}
|
||||
}
|
11
PyroFetes/Models/ProductCategory.cs
Normal file
11
PyroFetes/Models/ProductCategory.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace PyroFetes.Models;
|
||||
|
||||
public class ProductCategory
|
||||
{
|
||||
[Key] public int Id { get; set; }
|
||||
[Required, MaxLength(100)] public string? Label { get; set; }
|
||||
|
||||
public List<Product>? Products { get; set; }
|
||||
}
|
14
PyroFetes/Models/ProductColor.cs
Normal file
14
PyroFetes/Models/ProductColor.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace PyroFetes.Models;
|
||||
|
||||
[PrimaryKey(nameof(ProductId), nameof(ColorId))]
|
||||
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; }
|
||||
}
|
@@ -12,5 +12,4 @@ public class ProductDelivery
|
||||
|
||||
public Product? Product { get; set; }
|
||||
public DeliveryNote? DeliveryNote { get; set; }
|
||||
}
|
||||
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user