17:17 09/10

This commit is contained in:
2025-10-09 17:17:42 +02:00
parent 1734ec0219
commit 91b4aca2fa
76 changed files with 815 additions and 388 deletions

View File

@@ -1,4 +1,4 @@
namespace PyroFetes.DTO.Brand.Request;
namespace API.DTO.Brand.Request;
public class CreateBrandDto
{

View File

@@ -1,4 +1,4 @@
namespace PyroFetes.DTO.Brand.Request;
namespace API.DTO.Brand.Request;
public class UpdateBrandDto
{

View File

@@ -1,4 +1,4 @@
namespace PyroFetes.DTO.Brand.Response;
namespace API.DTO.Brand.Response;
public class GetBrandDto
{

View File

@@ -1,4 +1,4 @@
namespace PyroFetes.DTO.Classification.Request;
namespace API.DTO.Classification.Request;
public class CreateClassificationDto
{

View File

@@ -1,4 +1,4 @@
namespace PyroFetes.DTO.Classification.Request;
namespace API.DTO.Classification.Request;
public class UpdateClassificationDto
{

View File

@@ -1,4 +1,4 @@
namespace PyroFetes.DTO.Classification.Response;
namespace API.DTO.Classification.Response;
public class GetClassificationDto
{

View File

@@ -1,4 +1,4 @@
namespace PyroFetes.DTO.Color.Request;
namespace API.DTO.Color.Request;
public class CreateColorDto
{

View File

@@ -1,4 +1,4 @@
namespace PyroFetes.DTO.Color.Request;
namespace API.DTO.Color.Request;
public class UpdateColorDto
{

View File

@@ -1,4 +1,4 @@
namespace PyroFetes.DTO.Color.Response;
namespace API.DTO.Color.Response;
public class GetColorDto
{

View File

@@ -1,4 +1,4 @@
namespace PyroFetes.DTO.Effect.Request;
namespace API.DTO.Effect.Request;
public class CreateEffectDto
{

View File

@@ -1,4 +1,4 @@
namespace PyroFetes.DTO.Effect.Request;
namespace API.DTO.Effect.Request;
public class UpdateEffectDto
{

View File

@@ -1,4 +1,4 @@
namespace PyroFetes.DTO.Effect.Response;
namespace API.DTO.Effect.Response;
public class GetEffectDto
{

View File

@@ -1,4 +1,4 @@
namespace PyroFetes.DTO.Material.Request;
namespace API.DTO.Material.Request;
public class CreateMaterialDto
{

View File

@@ -1,4 +1,4 @@
namespace PyroFetes.DTO.Material.Request;
namespace API.DTO.Material.Request;
public class UpdateMaterialDto
{

View File

@@ -1,4 +1,4 @@
namespace PyroFetes.DTO.Material.Response;
namespace API.DTO.Material.Response;
public class GetMaterialDto
{

View File

@@ -1,21 +1,26 @@
using PyroFetes.Models;
using PyroFetes.DTO.Product.Request;
namespace PyroFetes.DTO.Product.Request;
public class CreateProductDto
namespace PyroFetes.DTO.Product.Request
{
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 decimal SellingPrice {get; set;}
public string? Image { get; set; }
public string? Link { get; set; }
public int ClassificationId { get; set;}
public int ProductCategoryId { get; set; }
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 decimal SellingPrice { get; set; }
public string? Image { get; set; }
public string? Link { get; set; }
public int ClassificationId { get; set;}
public int ProductCategoryId { get; set; }
// Liste des fournisseurs liés au produit
public List<ProductSupplierPriceDto>? Suppliers { get; set; }
// Liste des entrepôts liés au produit
public List<CreateProductWarehouseDto>? Warehouses { get; set; }
}
}

View File

@@ -1,20 +1,27 @@
using PyroFetes.Models;
using PyroFetes.DTO.Product.Request;
namespace PyroFetes.DTO.Product.Request;
public class UpdateProductDto
namespace PyroFetes.DTO.Product.Request
{
public int Id { get; set; }
public int Reference { 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 decimal SellingPrice {get; set;}
public string? Image { get; set; }
public string? Link { get; set; }
public int ClassificationId { get; set;}
public int ProductCategoryId { get; set; }
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 decimal SellingPrice { get; set; }
public string? Image { get; set; }
public string? Link { get; set; }
public int ClassificationId { get; set; }
public int ProductCategoryId { get; set; }
// Liste des fournisseurs associés
public List<ProductSupplierPriceDto> Suppliers { get; set; } = new();
// Liste des entrepôts associés
public List<UpdateProductWarehouseDto> Warehouses { get; set; } = new();
}
}

View File

@@ -1,23 +1,29 @@
using PyroFetes.Models;
using PyroFetes.DTO.Product.Request;
using PyroFetes.DTO.Product.Request;
using PyroFetes.DTO.Product.Response;
namespace PyroFetes.DTO.Product.Response;
public class GetProductDto
namespace PyroFetes.DTO.Product.Response
{
public int Id { get; set; }
public int Reference { 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 decimal SellingPrice {get; set;}
public string? Image { get; set; }
public string? Link { get; set; }
public int ClassificationId { get; set;}
public string? ClassificationLabel { get; set; }
public int ProductCategoryId { get; set; }
public string? ProductCategoryLabel { get; set; }
public class GetProductDto
{
public int Id { get; set; }
public int Reference { 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 decimal SellingPrice { get; set; }
public string? Image { get; set; }
public string? Link { get; set; }
public int ClassificationId { get; set; }
public int ProductCategoryId { get; set; }
// Fournisseurs liés
public List<ProductSupplierPriceDto> Suppliers { get; set; } = new();
// Entrepôts liés
public List<GetProductWarehouseDto> Warehouses { get; set; } = new();
}
}

View File

@@ -0,0 +1,10 @@
namespace PyroFetes.DTO.Product.Request
{
// DTO utilisé pour créer ou mettre à jour la relation Product <-> Supplier
public class ProductSupplierPriceDto
{
public int ProductId { get; set; } // Id du produit (pour update)
public int SupplierId { get; set; } // Id du fournisseur
public decimal SellingPrice { get; set; } // Prix de vente
}
}

View File

@@ -0,0 +1,11 @@
namespace PyroFetes.DTO.Product.Response
{
// DTO pour la lecture des fournisseurs liés à un produit
public class GetProductSupplierDto
{
public int ProductId { get; set; }
public int SupplierId { get; set; }
public string SupplierName { get; set; } = string.Empty;
public decimal SellingPrice { get; set; }
}
}

View File

@@ -0,0 +1,17 @@
namespace PyroFetes.DTO.Product.Request
{
// DTO utilisé pour créer ou mettre à jour la relation Product <-> Warehouse
public class CreateProductWarehouseDto
{
public int WarehouseId { get; set; }
public int ProductId { get; set; }
public int Quantity { get; set; }
}
public class UpdateProductWarehouseDto
{
public int WarehouseId { get; set; }
public int ProductId { get; set; }
public int Quantity { get; set; }
}
}

View File

@@ -0,0 +1,11 @@
namespace PyroFetes.DTO.Product.Response
{
// DTO pour la lecture des entrepôts liés à un produit
public class GetProductWarehouseDto
{
public int WarehouseId { get; set; }
public int ProductId { get; set; }
public string WarehouseName { get; set; } = string.Empty;
public int Quantity { get; set; }
}
}

View File

@@ -1,4 +1,4 @@
namespace API.DTO.Supplier.Request;
namespace PyroFetes.DTO.Supplier.Request;
public class CreateSupplierDto
{
@@ -8,4 +8,13 @@ public class CreateSupplierDto
public string Adress { get; set; }
public int ZipCode { get; set; }
public string City { get; set; }
// Produits que ce fournisseur fournit
public List<SupplierProductPriceDto>? Products { get; set; }
}
public class SupplierProductPriceDto
{
public int ProductId { get; set; }
public decimal SellingPrice { get; set; }
}

View File

@@ -1,4 +1,4 @@
namespace API.DTO.Supplier.Request;
namespace PyroFetes.DTO.Supplier.Request;
public class UpdateSupplierDto
{
@@ -9,4 +9,6 @@ public class UpdateSupplierDto
public string Adress { get; set; }
public int ZipCode { get; set; }
public string City { get; set; }
public List<SupplierProductPriceDto>? Products { get; set; }
}

View File

@@ -1,4 +1,6 @@
namespace API.DTO.Supplier.Response;
using PyroFetes.DTO.Supplier.Request;
namespace PyroFetes.DTO.Supplier.Response;
public class GetSupplierDto
{
@@ -9,4 +11,14 @@ public class GetSupplierDto
public string Adress { get; set; }
public int ZipCode { get; set; }
public string City { get; set; }
// Liste des produits liés avec leur prix fournisseur
public List<SupplierProductPriceDto> Products { get; set; }
}
public class GetSupplierProductDto
{
public int ProductId { get; set; }
public string ProductName { get; set; } = string.Empty;
public decimal SellingPrice { get; set; }
}

View File

@@ -2,11 +2,20 @@
public class CreateWarehouseDto
{
public string Name {get; set;}
public int MaxWeight {get; set;}
public int Current {get; set;}
public int MinWeight {get; set;}
public string Name { get; set; }
public int MaxWeight { get; set; }
public int Current { get; set; }
public int MinWeight { get; set; }
public string Adress { get; set; }
public int ZipCode { get; set; }
public string City { get; set; }
// Liste des produits à stocker dans cet entrepôt
public List<CreateWarehouseProductDto>? Products { get; set; }
}
public class CreateWarehouseProductDto
{
public int ProductId { get; set; }
public int Quantity { get; set; }
}

View File

@@ -1,13 +1,21 @@
namespace API.DTO.Warehouse.Request;
namespace API.DTO.Warehouse.Request;
public class UpdateWarehouseDto
{
public int Id {get; set;}
public string Name {get; set;}
public int MaxWeight {get; set;}
public int Current {get; set;}
public int MinWeight {get; set;}
public int Id { get; set; }
public string Name { get; set; }
public int MaxWeight { get; set; }
public int Current { get; set; }
public int MinWeight { get; set; }
public string Adress { get; set; }
public int ZipCode { get; set; }
public string City { get; set; }
public List<UpdateWarehouseProductDto>? Products { get; set; }
}
public class UpdateWarehouseProductDto
{
public int ProductId { get; set; }
public int Quantity { get; set; }
}

View File

@@ -1,13 +1,22 @@
namespace API.DTO.Warehouse.Response;
namespace API.DTO.Warehouse.Response;
public class GetWarehouseDto
{
public int Id {get; set;}
public string Name {get; set;}
public int MaxWeight {get; set;}
public int Current {get; set;}
public int MinWeight {get; set;}
public int Id { get; set; }
public string Name { get; set; }
public int MaxWeight { get; set; }
public int Current { get; set; }
public int MinWeight { get; set; }
public string Adress { get; set; }
public int ZipCode { get; set; }
public string City { get; set; }
public List<WarehouseProductDto>? Products { get; set; }
}
public class WarehouseProductDto
{
public int ProductId { get; set; }
public string? ProductName { get; set; }
public int Quantity { get; set; }
}