Commentaire des DTO

This commit is contained in:
2025-10-10 11:21:57 +02:00
parent 44da6ed371
commit b3347fe163
33 changed files with 595 additions and 240 deletions

View File

@@ -1,20 +1,37 @@
namespace PyroFetes.DTO.Supplier.Request;
public class CreateSupplierDto
namespace PyroFetes.DTO.Supplier.Request
{
public string Name { get; set; }
public string Email { get; set; }
public string PhoneNumber { get; set; }
public string Adress { get; set; }
public int ZipCode { get; set; }
public string City { get; set; }
// DTO pour créer un nouveau fournisseur
public class CreateSupplierDto
{
// Nom du fournisseur
public string Name { get; set; }
// Produits que ce fournisseur fournit
public List<SupplierProductPriceDto>? Products { get; set; }
}
// Email du fournisseur
public string Email { get; set; }
public class SupplierProductPriceDto
{
public int ProductId { get; set; }
public decimal SellingPrice { get; set; }
// Numéro de téléphone du fournisseur
public string PhoneNumber { get; set; }
// Adresse du fournisseur
public string Adress { get; set; }
// Code postal de l'adresse
public int ZipCode { get; set; }
// Ville de l'adresse
public string City { get; set; }
// Liste des produits fournis par ce fournisseur dans la classe SupplierProductPriceDto
public List<SupplierProductPriceDto>? Products { get; set; }
}
// DTO pour relier un produit et son prix à un fournisseur
public class SupplierProductPriceDto
{
// Identifiant du produit fourni
public int ProductId { get; set; }
// Prix de vente du produit par ce fournisseur
public decimal SellingPrice { get; set; }
}
}

View File

@@ -1,14 +1,30 @@
namespace PyroFetes.DTO.Supplier.Request;
public class UpdateSupplierDto
namespace PyroFetes.DTO.Supplier.Request
{
public int Id { get; set; }
public string Name { get; set; }
public string Email { get; set; }
public string PhoneNumber { get; set; }
public string Adress { get; set; }
public int ZipCode { get; set; }
public string City { get; set; }
// DTO pour mettre à jour un fournisseur existant
public class UpdateSupplierDto
{
// Identifiant du fournisseur à mettre à jour
public int Id { get; set; }
public List<SupplierProductPriceDto>? Products { get; set; }
// Nom du fournisseur
public string Name { get; set; }
// Email du fournisseur
public string Email { get; set; }
// Numéro de téléphone du fournisseur
public string PhoneNumber { get; set; }
// Adresse du fournisseur
public string Adress { get; set; }
// Code postal de l'adresse
public int ZipCode { get; set; }
// Ville de l'adresse
public string City { get; set; }
// Liste des produits fournis par ce fournisseur relié à la classe SupplierProductPriceDto
public List<SupplierProductPriceDto>? Products { get; set; }
}
}

View File

@@ -1,24 +1,45 @@
using PyroFetes.DTO.Supplier.Request;
namespace PyroFetes.DTO.Supplier.Response;
public class GetSupplierDto
namespace PyroFetes.DTO.Supplier.Response
{
public int Id { get; set; }
public string Name { get; set; }
public string Email { get; set; }
public string PhoneNumber { get; set; }
public string Adress { get; set; }
public int ZipCode { get; set; }
public string City { get; set; }
// DTO pour récupérer les informations d'un fournisseur
public class GetSupplierDto
{
// Identifiant du fournisseur
public int Id { get; set; }
// Liste des produits liés avec leur prix fournisseur
public List<SupplierProductPriceDto> Products { get; set; }
}
// Nom du fournisseur
public string Name { get; set; }
public class GetSupplierProductDto
{
public int ProductId { get; set; }
public string ProductName { get; set; } = string.Empty;
public decimal SellingPrice { get; set; }
// Email du fournisseur
public string Email { get; set; }
// Numéro de téléphone
public string PhoneNumber { get; set; }
// Adresse du fournisseur
public string Adress { get; set; }
// Code postal
public int ZipCode { get; set; }
// Ville
public string City { get; set; }
// Liste des produits fournis par la classe SupplierProductPriceDto
public List<SupplierProductPriceDto> Products { get; set; } = new();
}
// DTO pour les détails d'un produit lié à un fournisseur
public class GetSupplierProductDto
{
// Identifiant du produit
public int ProductId { get; set; }
// Nom du produit
public string ProductName { get; set; } = string.Empty;
// Prix de vente fourni par le fournisseur
public decimal SellingPrice { get; set; }
}
}