99 Commits

Author SHA1 Message Date
Cristiano
7f3ffde3ff Merge branch 'develop' 2025-11-27 14:56:14 +01:00
Cristiano
50a5f371dd Fixed Database 2025-11-27 14:35:35 +01:00
86c5d6ae7b new migration 2025-11-27 13:41:55 +01:00
1c0432a2c4 updated length of password in User.cs 2025-11-27 13:40:02 +01:00
6be43958fa updated length of password to 60 for bcrypt length 2025-11-27 13:28:05 +01:00
3e8f36457e fixed errors in database 2025-11-26 20:37:49 +01:00
5d68ee6992 fix length on approval number 2025-11-26 19:43:54 +01:00
Cristiano
d26284d552 Merge branch 'feature/repositories-refactor' into develop 2025-11-20 16:45:55 +01:00
Cristiano
d537051bea Fix Type errors 2025-11-20 16:45:44 +01:00
Cristiano
3ad506f869 Retired /api in all the endpoints 2025-11-20 16:33:56 +01:00
Cristiano
9aac7c39f2 Merge branch 'feature/repositories-refactor' into develop
# Conflicts:
#	PyroFetes/Endpoints/Price/CreatePriceEndpoint.cs
#	PyroFetes/Endpoints/Product/GetAllProductsEndpoint.cs
#	PyroFetes/Endpoints/Product/GetProductEndpoint.cs
#	PyroFetes/Endpoints/PurchaseOrder/GetAllPurchaseOrderEndpoint.cs
#	PyroFetes/Endpoints/PurchaseOrder/GetPurchaseOrderEndpoint.cs
#	PyroFetes/Endpoints/Quotation/GetAllQuotationEndpoint.cs
#	PyroFetes/Endpoints/Quotation/GetQuotationEndpoint.cs
#	PyroFetes/Endpoints/SettingEndpoints/CreateSettingEndpoint.cs
#	PyroFetes/Endpoints/SettingEndpoints/PatchSettingElectronicSignatureEndpoint.cs
#	PyroFetes/Endpoints/SettingEndpoints/PatchSettingLogoEndpoint.cs
#	PyroFetes/Endpoints/Supplier/CreateSupplierEndpoint.cs
#	PyroFetes/Endpoints/Supplier/GetAllSuppliersEndpoint.cs
#	PyroFetes/Endpoints/Supplier/GetSupplierEndpoint.cs
#	PyroFetes/Endpoints/Supplier/PatchSupplierDeleveryDelayEndpoint.cs
#	PyroFetes/Endpoints/User/GetAllUsersEndpoint.cs
#	PyroFetes/Endpoints/User/GetUserEndpoint.cs
2025-11-20 16:16:15 +01:00
Cristiano
b76b668097 Addapted to use cors and optimized connection with the frontend 2025-11-20 16:12:16 +01:00
Cristiano
669938d677 Refactored WarehouseProduct 2025-11-20 16:09:04 +01:00
Cristiano
165c9b9322 Refactored User 2025-11-20 15:38:53 +01:00
Cristiano
0b72549143 Refactored Program.cs 2025-11-20 15:20:13 +01:00
Cristiano
d64890dec9 Refactored Supplier 2025-11-20 15:11:14 +01:00
Cristiano
8325aa0768 Refactored Setting 2025-11-20 15:05:44 +01:00
Cristiano
ee9b4675dd Refactored Quotation 2025-11-20 14:34:09 +01:00
Cristiano
f6383265ba Refactored QuotationProduct 2025-11-20 14:20:25 +01:00
Cristiano
7bf0b5bfd1 Advanced refactoring 2025-11-20 14:04:13 +01:00
Cristiano
bd653c149c Finished refactoring prices endpoints 2025-11-19 18:05:28 +01:00
0511bb5075 added AllowAnonymous(); 2025-11-17 21:25:07 +01:00
27e8fea7f3 added AllowAnonymous(); 2025-11-17 21:20:04 +01:00
6dba61f742 suppr all 'var' and Models.xxx. And added 's' at the end of all directories endpoints 2025-11-17 20:49:12 +01:00
Cristiano
20bbccf883 Added last endpoints for delivery Note 2025-11-14 18:11:54 +01:00
Cristiano
d7cf245d35 Committed migration 2025-11-13 17:28:41 +01:00
Cristiano
2385b7b687 Made an update on database and added CreatingDeliveryNotee 2025-11-13 17:28:08 +01:00
Cristiano
ae834d1e3c Adapted Price Endpoints 2025-11-13 16:31:00 +01:00
Cristiano
c6d4ef2c58 Adapted Deliverer endpoints with repository spec and automapper 2025-11-13 15:26:22 +01:00
Cristiano
60a7c059b4 Merge remote-tracking branch 'origin/develop' into develop 2025-11-13 14:44:46 +01:00
Cristiano
9684dbcbc7 Merged AutoMapper branch 2025-11-13 14:44:28 +01:00
bbd8d3d36a Actualiser PyroFetes/DTO/Price/Request/CreatePriceDto.cs 2025-11-09 18:48:23 +01:00
7d92f80de3 Actualiser PyroFetes/Endpoints/Price/CreatePriceEndpoint.cs 2025-11-09 18:46:24 +01:00
304c06ed19 changed setting for SettingEndpoints 2025-11-07 17:45:35 +01:00
97a7c6811c created product's endpoints 2025-11-07 17:41:50 +01:00
f8b3c51435 fix error on CreatePriceEndpoint.cs 2025-11-06 19:25:35 +01:00
a535f8cfeb fix errors in Price's DTO 2025-11-06 18:51:46 +01:00
65b5e6afe3 Merge branch 'feature/CreatingProductEnpoints' into develop 2025-11-06 18:42:39 +01:00
33719b708e Creating of price's endpoints 2025-11-06 18:52:18 +01:00
b00ed36557 Merge remote-tracking branch 'origin/develop' into develop 2025-11-06 17:34:08 +01:00
be0a6a4004 Creating supplier's endpoints 2025-11-06 17:30:03 +01:00
Cristiano
6bc8281a37 AddedAutoMapper 2025-11-06 16:17:35 +01:00
Cristiano
9ff5c038b1 HOTFIX 2025-11-06 16:16:49 +01:00
Cristiano
4bdd8104d8 Fix wrong HTTP method 2025-11-06 16:11:37 +01:00
Cristiano
abc843778f Merge branch 'feature/CreatingDelivererEndpoint' into develop 2025-11-06 16:10:38 +01:00
Cristiano
c0090da9bd Fix unused imports 2025-11-06 16:08:52 +01:00
Cristiano
554ba9b725 Added all the endpoints needed for Deliverer 2025-11-06 15:54:53 +01:00
1c898f9144 Merge branch 'feature/UserEndpoints' into develop 2025-10-27 12:56:04 +01:00
7bb21be0e6 add patch from user for the password 2025-10-27 12:55:25 +01:00
6a4760fb72 Creation user's endpoints 2025-10-27 12:31:25 +01:00
06c64a9f3f add token 2025-10-17 16:53:00 +01:00
aa1c98d649 fix error in api's route 2025-10-17 16:47:34 +01:00
fa72c6d777 creating endpoint WareHouseProduct 2025-10-17 16:23:39 +01:00
59628717d4 rename directory 2025-10-17 15:51:03 +01:00
ff590302e2 Created all endpoints for Quotation and QuotationProduct 2025-10-17 01:05:50 +01:00
45f6baaac3 created quotation's dtos 2025-10-17 00:13:41 +01:00
ef9740d8ff creating PatchPurchaseOrderPurchaseConditionsEndpoint.cs 2025-10-17 00:04:37 +01:00
3ada21adae Creating all setting's endpoints 2025-10-16 23:50:00 +01:00
4f12911263 creating endpoints from PurchaseOrder 2025-10-16 23:28:27 +01:00
8bd7fadabc Merge branch 'feature/CreatingPurchaseProductEndpoints' into develop 2025-10-16 22:55:09 +01:00
e4e6c1c3f7 creating purchaseproduct's endpoint and fix error in dto 2025-10-16 22:53:14 +01:00
791eff9256 added 2025-10-16 19:32:31 +01:00
b4502ae562 editing dto from purchaseproduct 2025-10-16 18:48:55 +01:00
347003c24a updating CreatePurchaseProductEndpoint.cs and GetPurchaseProductDto.cs 2025-10-16 18:40:30 +01:00
31e69aae1a Creating purchaseproduct's endpoint 2025-10-16 17:53:16 +02:00
74b5fa6666 editing dto from PurchaseProduct 2025-10-16 17:24:36 +02:00
b79e07dd8b Adding entities from database and migrating 2025-10-13 18:57:45 +01:00
Cristiano
3192d399cc Fixed name of directory Deliverer 2025-10-11 01:41:16 +02:00
Cristiano
37f6460615 Creating DTO of Deliver and fixing some typing errors 2025-10-11 01:38:41 +02:00
Cristiano
ecd8883d55 Creating DTO of ProductDelivery with flattening 2025-10-11 01:29:02 +02:00
Cristiano
0209dbfc20 Creating DTO of DeliveryNote with flattening 2025-10-11 01:09:09 +02:00
e773e201bd Merge tag 'EditingDatabase' into develop
Merge into master
2025-10-10 10:46:20 +02:00
e336a50c4e Merge branch 'release/EditingDatabase' 2025-10-10 10:46:02 +02:00
e63be6e1f1 Merge branch 'feature/EditingDatabase' into develop 2025-10-10 10:37:37 +02:00
5a36c0ff2f Migration 2025-10-10 10:37:13 +02:00
014646d35c Migration 2025-10-10 10:36:58 +02:00
8371423b16 Editing Product.cs 2025-10-10 10:35:23 +02:00
f7931fbed6 Merge branch 'feature/CreatingQuotationProductDTO' into develop 2025-10-09 19:12:18 +01:00
feb12b8c3b Merge branch 'feature/CreatingPurchaseProductDTO' into develop 2025-10-09 19:11:30 +01:00
5ea5edaea6 Merge branch 'feature/CreatingProductDTO' into develop 2025-10-09 19:10:29 +01:00
aa65139b69 Merge branch 'feature/CreatingSupplierDTO' into develop 2025-10-09 19:10:03 +01:00
9be4fa67e6 Merge branch 'feature/CreatingWareHouseProductDTO' into develop 2025-10-09 19:09:25 +01:00
e69ca1898d delete productsellingprice 2025-10-09 19:06:11 +01:00
15526d1589 delete productsellingprice 2025-10-09 19:04:22 +01:00
a27cb5cf2a fix an error 2025-10-09 19:03:09 +01:00
ddbd662c2a fix an error in product attribute 2025-10-09 19:02:09 +01:00
464869e3ca Creating of all price dto 2025-10-09 19:00:55 +01:00
25d1407bd2 Creating of all product dto 2025-10-09 17:54:28 +02:00
a262fb094c Creating all supplier dto 2025-10-09 17:47:12 +02:00
f0ec7cd4d4 Fix 2025-10-09 17:43:32 +02:00
d0f20e08f0 Fix an error in Setting directory 2025-10-09 17:34:46 +02:00
b1d2d3d1a1 Creating all QuotationProductDTO 2025-10-09 17:25:48 +02:00
64fd223a63 Fix an error in PatchPurchaseProductQuantityDto.cs 2025-10-09 17:09:33 +02:00
59ddb9f7b2 Creating all WareHouseProduct DTO 2025-10-09 17:08:01 +02:00
2d42fa1017 Creating all PurchaseProduct DTO 2025-10-09 16:46:22 +02:00
b859e53f95 Creating all setting Dto 2025-10-09 16:34:12 +02:00
3cc96c4ebf Creating user Dto 2025-10-09 16:25:04 +02:00
6a813fc35a Ajouter README.md 2025-10-08 14:44:42 +02:00
a93d399942 Merge branch 'release/V1' 2025-10-08 11:47:34 +01:00
245 changed files with 18065 additions and 3408 deletions

View File

@@ -1,9 +0,0 @@
namespace PyroFetes.DTO.Brand.Request
{
// DTO pour créer une nouvelle marque
public class CreateBrandDto
{
// Nom de la marque
public string? Name { get; set; }
}
}

View File

@@ -1,12 +0,0 @@
namespace PyroFetes.DTO.Brand.Request
{
// DTO pour mettre à jour une marque existante
public class UpdateBrandDto
{
// Identifiant de la marque à mettre à jour
public int Id { get; set; }
// Nouveau nom de la marque
public string? Name { get; set; }
}
}

View File

@@ -1,12 +0,0 @@
namespace API.DTO.Brand.Response
{
// DTO pour récupérer les informations d'une marque
public class GetBrandDto
{
// Identifiant de la marque
public int Id { get; set; }
// Nom de la marque
public string? Name { get; set; }
}
}

View File

@@ -1,11 +0,0 @@
// Définition de l'espace de noms pour les DTO liés à la création de classifications
namespace API.DTO.Classification.Request
{
// DTO (Data Transfer Object) utilisé pour créer une nouvelle classification
public class CreateClassificationDto
{
// Propriété représentant le nom ou le label de la classification
// Le type "string?" signifie que cette valeur peut être null
public string? Label { get; set; }
}
}

View File

@@ -1,15 +0,0 @@
// Définition de l'espace de noms pour les DTO liés à la mise à jour de classifications
namespace API.DTO.Classification.Request
{
// DTO (Data Transfer Object) utilisé pour mettre à jour une classification existante
public class UpdateClassificationDto
{
// Propriété représentant l'ID unique de la classification à mettre à jour
public int Id { get; set; }
// Propriété représentant le nouveau nom ou label de la classification
// Le type "string?" signifie que cette valeur peut être null
// Si null, le label ne sera pas modifié
public string? Label { get; set; }
}
}

View File

@@ -1,14 +0,0 @@
// Définition de l'espace de noms pour les DTO utilisés dans les réponses liées aux classifications
namespace API.DTO.Classification.Response
{
// DTO (Data Transfer Object) utilisé pour renvoyer les informations d'une classification
public class GetClassificationDto
{
// Propriété représentant l'ID unique de la classification
public int Id { get; set; }
// Propriété représentant le nom ou label de la classification
// Le type "string?" signifie que cette valeur peut être null si la classification n'a pas de label
public string? Label { get; set; }
}
}

View File

@@ -1,11 +0,0 @@
// Définition de l'espace de noms pour les DTO utilisés dans les requêtes liées aux couleurs
namespace API.DTO.Color.Request
{
// DTO utilisé pour créer une nouvelle couleur
public class CreateColorDto
{
// Propriété représentant le nom ou label de la couleur à créer
// Le type "string?" signifie que cette valeur peut être null si le label n'est pas fourni
public string? Label { get; set; }
}
}

View File

@@ -1,14 +0,0 @@
// Définition de l'espace de noms pour les DTO utilisés dans les requêtes liées aux couleurs
namespace API.DTO.Color.Request
{
// DTO utilisé pour mettre à jour une couleur existante
public class UpdateColorDto
{
// Identifiant unique de la couleur à mettre à jour
public int Id { get; set; }
// Nouveau nom ou label de la couleur
// Le type "string?" signifie que cette valeur peut être null si aucun changement n'est fourni
public string? Label { get; set; }
}
}

View File

@@ -1,14 +0,0 @@
// Définition de l'espace de noms pour les DTO utilisés dans les réponses liées aux couleurs
namespace API.DTO.Color.Response
{
// DTO utilisé pour renvoyer les informations d'une couleur
public class GetColorDto
{
// Identifiant unique de la couleur
public int Id { get; set; }
// Nom ou label de la couleur
// Le type "string?" signifie que cette valeur peut être null si le label n'est pas défini
public string? Label { get; set; }
}
}

View File

@@ -0,0 +1,6 @@
namespace PyroFetes.DTO.Deliverer.Request;
public class CreateDelivererDto
{
public string? Transporter { get; set; }
}

View File

@@ -0,0 +1,7 @@
namespace PyroFetes.DTO.Deliverer.Request;
public class UpdateDelivererDto
{
public int Id { get; set; }
public string? Transporter { get; set; }
}

View 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; }
}

View File

@@ -0,0 +1,12 @@
namespace PyroFetes.DTO.DeliveryNote.Request;
public class CreateDeliveryNoteDto
{
public string? TrackingNumber { get; set; }
public DateOnly EstimateDeliveryDate { get; set; }
public DateOnly ExpeditionDate { get; set; }
public int DelivererId { get; set; }
public Dictionary<int,int>? ProductQuantities { get; set; }
}

View File

@@ -0,0 +1,7 @@
namespace PyroFetes.DTO.DeliveryNote.Request;
public class PatchDeliveryNoteRealDeliveryDateDto
{
public int Id { get; set; }
public DateOnly RealDeliveryDate { get; set; }
}

View 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; }
}

View 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; }
}

View File

@@ -1,11 +0,0 @@
// Définition de l'espace de noms pour les DTO utilisés dans les requêtes liées aux effets
namespace API.DTO.Effect.Request
{
// DTO utilisé pour créer un nouvel effet
public class CreateEffectDto
{
// Nom ou label de l'effet
// Le type "string?" signifie que cette valeur peut être null si aucun label n'est fourni
public string? Label { get; set; }
}
}

View File

@@ -1,14 +0,0 @@
// Définition de l'espace de noms pour les DTO utilisés dans les requêtes liées aux effets
namespace API.DTO.Effect.Request
{
// DTO utilisé pour mettre à jour un effet existant
public class UpdateEffectDto
{
// Identifiant unique de l'effet à mettre à jour
public int Id { get; set; }
// Nouveau nom ou label de l'effet
// Le type "string?" signifie que cette valeur peut être null si aucun label n'est fourni
public string? Label { get; set; }
}
}

View File

@@ -1,14 +0,0 @@
// Définition de l'espace de noms pour les DTO utilisés dans les réponses liées aux effets
namespace API.DTO.Effect.Response
{
// DTO utilisé pour renvoyer les informations d'un effet
public class GetEffectDto
{
// Identifiant unique de l'effet
public int Id { get; set; }
// Nom ou label de l'effet
// Le type "string?" signifie que cette valeur peut être null si aucune valeur n'est disponible
public string? Label { get; set; }
}
}

View File

@@ -1,7 +0,0 @@
namespace PyroFetes.DTO.Login.Request;
public class ConnectLoginDto
{
public string? Username { get; set; }
public string? Password { get; set; }
}

View File

@@ -1,8 +0,0 @@
namespace PyroFetes.DTO.Login.Request;
public class CreateLoginDto
{
public string? Username { get; set; }
public string? FullName { get; set; }
public string? Password { get; set; }
}

View File

@@ -1,9 +0,0 @@
namespace PyroFetes.DTO.Login.Request;
public class UpdateLoginDto
{
public int Id { get; set; }
public string? Username { get; set; }
public string? FullName { get; set; }
public string? Password { get; set; }
}

View File

@@ -1,6 +0,0 @@
namespace PyroFetes.DTO.Login.Response;
public class GetLoginConnectDto
{
public string? Token { get; set; }
}

View File

@@ -1,10 +0,0 @@
namespace PyroFetes.DTO.Login.Response;
public class GetLoginDto
{
public int Id { get; set; }
public string? Username { get; set; }
public string? FullName { get; set; }
public string? Password { get; set; }
public string? Salt { get; set; }
}

View File

@@ -1,17 +0,0 @@
// Définition de l'espace de noms pour les DTO utilisés dans les requêtes liées aux matériaux
namespace API.DTO.Material.Request
{
// DTO utilisé pour créer un nouveau matériau
public class CreateMaterialDto
{
// Nom ou label du matériau
// Le type "string?" signifie que cette valeur peut être null si aucune valeur n'est fournie
public string? Label { get; set; }
// Quantité du matériau à créer
public int Quantity { get; set; }
// Identifiant de l'entrepôt dans lequel le matériau sera stocké
public int WarehouseId { get; set; }
}
}

View File

@@ -1,20 +0,0 @@
// Définition de l'espace de noms pour les DTO utilisés dans les requêtes liées aux matériaux
namespace API.DTO.Material.Request
{
// DTO utilisé pour mettre à jour un matériau existant
public class UpdateMaterialDto
{
// Identifiant unique du matériau à mettre à jour
public int Id { get; set; }
// Nom ou label du matériau
// Le type "string?" signifie que cette valeur peut être null si aucune valeur n'est fournie
public string? Label { get; set; }
// Quantité mise à jour du matériau
public int Quantity { get; set; }
// Identifiant de l'entrepôt associé au matériau
public int WarehouseId { get; set; }
}
}

View File

@@ -1,20 +0,0 @@
// Définition de l'espace de noms pour les DTO utilisés dans les réponses liées aux matériaux
namespace API.DTO.Material.Response
{
// DTO utilisé pour renvoyer les informations d'un matériau
public class GetMaterialDto
{
// Identifiant unique du matériau
public int Id { get; set; }
// Nom ou label du matériau
// Le type "string?" signifie que cette valeur peut être null si aucune valeur n'est définie
public string? Label { get; set; }
// Quantité disponible du matériau
public int Quantity { get; set; }
// Identifiant de l'entrepôt auquel le matériau est associé
public int WarehouseId { get; set; }
}
}

View File

@@ -1,19 +0,0 @@
// Définition de l'espace de noms pour les DTO utilisés dans les requêtes liées aux mouvements
namespace API.DTO.Movement.Request
{
// DTO utilisé pour créer un nouveau mouvement
public class CreateMovementDto
{
// Date à laquelle le mouvement est enregistré
public DateTime Date { get; set; }
// Date et heure de début du mouvement
public DateTime Start { get; set; }
// Date et heure d'arrivée prévue du mouvement
public DateTime Arrival { get; set; }
// Quantité de matériaux ou objets impliqués dans le mouvement
public int Quantity { get; set; }
}
}

View File

@@ -1,22 +0,0 @@
// Définition de l'espace de noms pour les DTO utilisés dans les requêtes liées aux mouvements
namespace API.DTO.Movement.Request
{
// DTO utilisé pour mettre à jour un mouvement existant
public class UpdateMovementDto
{
// ID unique du mouvement à mettre à jour
public int Id { get; set; }
// Date à laquelle le mouvement est enregistré
public DateTime Date { get; set; }
// Date et heure de début du mouvement
public DateTime Start { get; set; }
// Date et heure d'arrivée prévue du mouvement
public DateTime Arrival { get; set; }
// Quantité de matériaux ou objets impliqués dans le mouvement
public int Quantity { get; set; }
}
}

View File

@@ -1,22 +0,0 @@
// Définition de l'espace de noms pour les DTO utilisés dans les réponses liées aux mouvements
namespace API.DTO.Movement.Response
{
// DTO utilisé pour renvoyer les informations d'un mouvement
public class GetMovementDto
{
// ID unique du mouvement
public int Id { get; set; }
// Date à laquelle le mouvement est enregistré
public DateTime Date { get; set; }
// Date et heure de début du mouvement
public DateTime Start { get; set; }
// Date et heure d'arrivée prévue du mouvement
public DateTime Arrival { get; set; }
// Quantité de matériaux ou objets impliqués dans le mouvement
public int Quantity { get; set; }
}
}

View 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 string? SupplierZipCode { get; set; }
public string? SupplierCity { get; set; }
public int SupplierDeliveryDelay { get; set; }
public int? ProductId { get; set; }
public string? ProductReferences { get; set; }
public string? ProductName { get; set; }
public decimal ProductDuration {get; set;}
public int ProductCaliber { get; set; }
public string? ProductApprovalNumber { get; set; }
public decimal ProductWeight { get; set; }
public decimal ProductNec { get; set; }
public string? ProductImage { get; set; }
public string? ProductLink { get; set; }
public int ProductMinimalQuantity { get; set; }
}

View File

@@ -0,0 +1,8 @@
namespace PyroFetes.DTO.Price.Request;
public class PatchPriceSellingPriceDto
{
public int ProductId { get; set; }
public int SupplierId { get; set; }
public decimal SellingPrice { get; set; }
}

View 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 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; }
}

View 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 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; }
}

View File

@@ -1,50 +1,15 @@
using PyroFetes.DTO.Product.Request;
namespace PyroFetes.DTO.Product.Request;
namespace PyroFetes.DTO.Product.Request
public class CreateProductDto
{
// DTO utilisé lors de la création dun produit
public class CreateProductDto
{
// Référence interne du produit
public int References { get; set; }
// Nom du produit
public string? Name { get; set; }
// Durée de leffet du produit
public decimal Duration { get; set; }
// Calibre du produit
public decimal Caliber { get; set; }
// Numéro dhomologation
public int ApprovalNumber { get; set; }
// Poids du produit
public decimal Weight { get; set; }
// Matière active (NEC)
public decimal Nec { get; set; }
// Prix de vente du produit
public decimal SellingPrice { get; set; }
// Image associée au produit (URL ou chemin)
public string? Image { get; set; }
// Lien vers une ressource externe (vidéo, fiche, etc.)
public string? Link { get; set; }
// Identifiant de la classification du produit
public int ClassificationId { get; set; }
// Identifiant de la catégorie du produit
public int ProductCategoryId { get; set; }
// Liste des fournisseurs liés au produit venant du DTO ProductSupplierPriceDto
public List<ProductSupplierPriceDto>? Suppliers { get; set; }
// Liste des entrepôts liés au produit venant du DTO CreateProductWarehouseDto
public List<CreateProductWarehouseDto>? Warehouses { get; set; }
}
public string? References { get; set; }
public string? Name { get; set; }
public decimal Duration {get; set;}
public int Caliber { get; set; }
public string? ApprovalNumber { get; set; }
public decimal Weight { get; set; }
public decimal Nec { get; set; }
public string? Image { get; set; }
public string? Link { get; set; }
public int MinimalQuantity { get; set; }
}

View File

@@ -0,0 +1,7 @@
namespace PyroFetes.DTO.Product.Request;
public class PatchProductMinimalStockDto
{
public int Id { get; set; }
public int MinimalQuantity { get; set; }
}

View File

@@ -1,53 +1,16 @@
using PyroFetes.DTO.Product.Request;
namespace PyroFetes.DTO.Product.Request;
namespace PyroFetes.DTO.Product.Request
public class UpdateProductDto
{
// DTO utilisé pour la mise à jour dun produit existant
public class UpdateProductDto
{
// Identifiant unique du produit à modifier
public int Id { get; set; }
// Référence interne du produit
public int References { get; set; }
// Nom du produit
public string? Name { get; set; }
// Durée de leffet du produit
public decimal Duration { get; set; }
// Calibre du produit
public decimal Caliber { get; set; }
// Numéro dhomologation
public int ApprovalNumber { get; set; }
// Poids du produit
public decimal Weight { get; set; }
// Matière active (NEC)
public decimal Nec { get; set; }
// Prix de vente du produit
public decimal SellingPrice { get; set; }
// Image associée au produit (URL ou chemin)
public string? Image { get; set; }
// Lien vers une ressource externe (fiche, vidéo, etc.)
public string? Link { get; set; }
// Identifiant de la classification du produit
public int ClassificationId { get; set; }
// Identifiant de la catégorie du produit
public int ProductCategoryId { get; set; }
// Liste des fournisseurs associés venant du DTO ProductSupplierPriceDto
public List<ProductSupplierPriceDto> Suppliers { get; set; } = new();
// Liste des entrepôts associés venant du DTO UpdateProductWarehouseDto
public List<UpdateProductWarehouseDto> Warehouses { get; set; } = new();
}
public int Id { get; set; }
public string? References { get; set; }
public string? Name { get; set; }
public decimal Duration {get; set;}
public int Caliber { get; set; }
public string? ApprovalNumber { get; set; }
public decimal Weight { get; set; }
public decimal Nec { get; set; }
public string? Image { get; set; }
public string? Link { get; set; }
public int MinimalQuantity { get; set; }
}

View File

@@ -1,54 +1,16 @@
using PyroFetes.DTO.Product.Request;
using PyroFetes.DTO.Product.Response;
namespace PyroFetes.DTO.Product.Response;
namespace PyroFetes.DTO.Product.Response
public class GetProductDto
{
// DTO utilisé pour renvoyer les informations complètes dun produit
public class GetProductDto
{
// Identifiant unique du produit
public int Id { get; set; }
// Référence interne du produit
public int Reference { get; set; }
// Nom du produit
public string? Name { get; set; }
// Durée de leffet du produit
public decimal Duration { get; set; }
// Calibre du produit
public decimal Caliber { get; set; }
// Numéro dhomologation
public int ApprovalNumber { get; set; }
// Poids du produit
public decimal Weight { get; set; }
// Matière active (NEC)
public decimal Nec { get; set; }
// Prix de vente du produit
public decimal SellingPrice { get; set; }
// Image du produit (URL ou chemin)
public string? Image { get; set; }
// Lien externe vers plus dinformations (fiche, vidéo, etc.)
public string? Link { get; set; }
// Identifiant de la classification du produit
public int ClassificationId { get; set; }
// Identifiant de la catégorie du produit
public int ProductCategoryId { get; set; }
// Fournisseurs liés venant du DTO ProductSupplierPriceDto
public List<ProductSupplierPriceDto> Suppliers { get; set; } = new();
// Entrepôts liés venant du DTO ProductWarehouseDto
public List<GetProductWarehouseDto> Warehouses { get; set; } = new();
}
public int Id { get; set; }
public string? References { get; set; }
public string? Name { get; set; }
public decimal Duration {get; set;}
public int Caliber { get; set; }
public string? ApprovalNumber { get; set; }
public decimal Weight { get; set; }
public decimal Nec { get; set; }
public string? Image { get; set; }
public string? Link { get; set; }
public int MinimalQuantity { get; set; }
}

View File

@@ -1,9 +0,0 @@
namespace API.DTO.ProductCategory.Request
{
// DTO pour créer une catégorie de produit
public class CreateProductCategoryDto
{
// Nom de la catégorie
public string? Label { get; set; }
}
}

View File

@@ -1,12 +0,0 @@
namespace API.DTO.ProductCategory.Request
{
// DTO pour mettre à jour une catégorie de produit
public class UpdateProductCategoryDto
{
// Identifiant de la catégorie
public int Id { get; set; }
// Nom de la catégorie
public string? Label { get; set; }
}
}

View File

@@ -1,12 +0,0 @@
namespace API.DTO.ProductCategory.Response
{
// DTO pour récupérer une catégorie de produit
public class GetProductCategoryDto
{
// Identifiant de la catégorie
public int Id { get; set; }
// Nom de la catégorie
public string? Label { get; set; }
}
}

View File

@@ -1,7 +0,0 @@
namespace PyroFetes.DTO.ProductColor.Request;
// DTO utilisé pour créer ou mettre à jour la relation Product <-> Color
public class ProductColorDto
{
public int ProductId { get; set; } // Id du produit (pour update)
public int ColorId { get; set; } // Id de la couleur
}

View File

@@ -1,11 +0,0 @@
namespace PyroFetes.DTO.ProductColor.Response;
// DTO utilisé pour renvoyer les informations dun produit lié à une couleur
public class GetProductColorDto
{
// Identifiant du produit concerné
public int ProductId { get; set; }
// Identifiant de la couleur
public int ColorId { get; set; }
}

View File

@@ -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; }
}

View File

@@ -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; }
}

View File

@@ -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; }
}

View File

@@ -1,8 +0,0 @@
namespace PyroFetes.DTO.ProductEffect.Request;
// DTO utilisé pour créer ou mettre à jour la relation Product <-> Effect
public class ProductEffectDto
{
public int ProductId { get; set; } // Id du produit (pour update)
public int EffectId { get; set; } // Id de l'effet
}

View File

@@ -1,12 +0,0 @@
namespace PyroFetes.DTO.ProductEffect.Response;
// DTO utilisé pour renvoyer les informations dun produit lié à un effet
public class GetProductEffectDto
{
// Identifiant du produit concerné
public int ProductId { get; set; }
// Identifiant de l'effet
public int EffectId { get; set; }
}

View File

@@ -1,10 +0,0 @@
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

@@ -1,18 +0,0 @@
namespace PyroFetes.DTO.Product.Response
{
// DTO utilisé pour renvoyer les informations dun fournisseur lié à un produit
public class GetProductSupplierDto
{
// Identifiant du produit concerné
public int ProductId { get; set; }
// Identifiant du fournisseur
public int SupplierId { get; set; }
// Nom du fournisseur
public string SupplierName { get; set; } = string.Empty;
// Prix de vente du produit fourni par ce fournisseur
public decimal SellingPrice { get; set; }
}
}

View File

@@ -1,28 +0,0 @@
namespace PyroFetes.DTO.Product.Request
{
// DTO utilisé lors de la création dune relation entre un produit et un entrepôt
public class CreateProductWarehouseDto
{
// Identifiant de l'entrepôt concerné
public int WarehouseId { get; set; }
// Identifiant du produit associé à cet entrepôt
public int ProductId { get; set; }
// Quantité du produit disponible dans cet entrepôt
public int Quantity { get; set; }
}
// DTO utilisé lors de la mise à jour dune relation entre un produit et un entrepôt
public class UpdateProductWarehouseDto
{
// Identifiant de l'entrepôt concerné
public int WarehouseId { get; set; }
// Identifiant du produit associé à cet entrepôt
public int ProductId { get; set; }
// Nouvelle quantité du produit dans cet entrepôt
public int Quantity { get; set; }
}
}

View File

@@ -1,18 +0,0 @@
namespace PyroFetes.DTO.Product.Response
{
// DTO utilisé pour renvoyer les informations dun entrepôt lié à un produit
public class GetProductWarehouseDto
{
// Identifiant de l'entrepôt
public int WarehouseId { get; set; }
// Identifiant du produit associé à cet entrepôt
public int ProductId { get; set; }
// Nom de l'entrepôt (utile pour laffichage)
public string WarehouseName { get; set; } = string.Empty;
// Quantité du produit stockée dans cet entrepôt
public int Quantity { get; set; }
}
}

View File

@@ -0,0 +1,7 @@
namespace PyroFetes.DTO.PurchaseOrder.Request;
public class PatchPurchaseOrderPurchaseConditionsDto
{
public int Id { get; set; }
public string? PurchaseConditions { get; set; }
}

View 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; }
}

View File

@@ -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; }
}

View File

@@ -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; }
}

View File

@@ -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; }
}

View File

@@ -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; }
}

View File

@@ -0,0 +1,7 @@
namespace PyroFetes.DTO.Quotation.Request;
public class PatchQuotationConditionsSaleDto
{
public int Id { get; set; }
public string? ConditionsSale { get; set; }
}

View File

@@ -0,0 +1,7 @@
namespace PyroFetes.DTO.Quotation.Request;
public class PatchQuotationMessageDto
{
public int Id { get; set; }
public string? Message { get; set; }
}

View 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; }
}

View File

@@ -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; }
}

View File

@@ -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; }
}

View File

@@ -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; }
}

View File

@@ -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; }
}

View File

@@ -0,0 +1,7 @@
namespace PyroFetes.DTO.SettingDTO.Request;
public class CreateSettingDto
{
public string? ElectronicSignature { get; set; }
public string? Logo { get; set; }
}

View File

@@ -0,0 +1,7 @@
namespace PyroFetes.DTO.SettingDTO.Request;
public class PatchSettingElectronicSignatureDto
{
public int Id { get; set; }
public string? ElectronicSignature { get; set; }
}

View File

@@ -0,0 +1,7 @@
namespace PyroFetes.DTO.SettingDTO.Request;
public class PatchSettingLogoDto
{
public int Id { get; set; }
public string? Logo { get; set; }
}

View 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; }
}

View File

@@ -1,37 +1,12 @@
namespace PyroFetes.DTO.Supplier.Request
namespace PyroFetes.DTO.Supplier.Request;
public class CreateSupplierDto
{
// DTO pour créer un nouveau fournisseur
public class CreateSupplierDto
{
// 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 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; }
}
public string? Name { get; set; }
public string? Email { get; set; }
public string? Phone { get; set; }
public string? Address { get; set; }
public string? ZipCode { get; set; }
public string? City { get; set; }
public int DeliveryDelay { get; set; }
}

View File

@@ -0,0 +1,7 @@
namespace PyroFetes.DTO.Supplier.Request;
public class PatchSupplierDeliveryDelayDto
{
public int Id { get; set; }
public int DeliveryDelay { get; set; }
}

View File

@@ -1,30 +1,13 @@
namespace PyroFetes.DTO.Supplier.Request
namespace PyroFetes.DTO.Supplier.Request;
public class UpdateSupplierDto
{
// DTO pour mettre à jour un fournisseur existant
public class UpdateSupplierDto
{
// Identifiant du fournisseur à mettre à jour
public int Id { 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; }
}
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 string? ZipCode { get; set; }
public string? City { get; set; }
public int DeliveryDelay { get; set; }
}

View File

@@ -1,45 +1,13 @@
using PyroFetes.DTO.Supplier.Request;
namespace PyroFetes.DTO.Supplier.Response;
namespace PyroFetes.DTO.Supplier.Response
public class GetSupplierDto
{
// DTO pour récupérer les informations d'un fournisseur
public class GetSupplierDto
{
// Identifiant du fournisseur
public int Id { get; set; }
// Nom du fournisseur
public string Name { 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; }
}
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 string? ZipCode { get; set; }
public string? City { get; set; }
public int DeliveryDelay { get; set; }
}

View File

@@ -0,0 +1,7 @@
namespace PyroFetes.DTO.User.Request;
public class ConnectUserDto
{
public string? Name { get; set; }
public string? Password { get; set; }
}

View File

@@ -0,0 +1,9 @@
namespace PyroFetes.DTO.User.Request;
public class CreateUserDto
{
public string? Name { get; set; }
public string? Password { get; set; }
public string? Fonction { get; set; }
public string? Email { get; set; }
}

View File

@@ -0,0 +1,7 @@
namespace PyroFetes.DTO.User.Request;
public class PatchUserPasswordDto
{
public int Id { get; set; }
public string? Password { get; set; }
}

View 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; }
}

View File

@@ -0,0 +1,6 @@
namespace PyroFetes.DTO.User.Response;
public class GetTokenDto
{
public string? Token { get; set; }
}

View 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; }
}

View File

@@ -0,0 +1,8 @@
namespace PyroFetes.DTO.WareHouseProduct.Request;
public class PatchWareHouseProductQuantityDto
{
public int WareHouseId { get; set; }
public int ProductId { get; set; }
public int Quantity { get; set; }
}

View File

@@ -0,0 +1,7 @@
namespace PyroFetes.DTO.WareHouseProduct.Response;
public class GetTotalQuantityDto
{
public int ProductId { get; set; }
public int TotalQuantity { get; set; }
}

View File

@@ -0,0 +1,8 @@
namespace PyroFetes.DTO.WareHouseProduct.Response;
public class GetWareHouseProductDto
{
public int Quantity { get; set; }
public int WareHouseId { get; set; }
public int ProductId { get; set; }
}

View File

@@ -1,40 +0,0 @@
namespace API.DTO.Warehouse.Request
{
// DTO pour créer un entrepôt
public class CreateWarehouseDto
{
// Nom de l'entrepôt
public string Name { get; set; }
// Poids maximal que l'entrepôt peut contenir
public int MaxWeight { get; set; }
// Poids actuel stocké
public int Current { get; set; }
// Poids minimal souhaité
public int MinWeight { get; set; }
// Adresse de l'entrepôt
public string Adress { get; set; }
// Code postal
public int ZipCode { get; set; }
// Ville
public string City { get; set; }
// Liste des produits à stocker dans cet entrepôt venant de la classe en dessous
public List<CreateWarehouseProductDto>? Products { get; set; }
}
// DTO pour associer un produit à un entrepôt
public class CreateWarehouseProductDto
{
// Identifiant du produit
public int ProductId { get; set; }
// Quantité du produit dans l'entrepôt
public int Quantity { get; set; }
}
}

View File

@@ -1,43 +0,0 @@
namespace API.DTO.Warehouse.Request
{
// DTO pour mettre à jour un entrepôt
public class UpdateWarehouseDto
{
// Identifiant de l'entrepôt à mettre à jour
public int Id { get; set; }
// Nom de l'entrepôt
public string Name { get; set; }
// Poids maximal que l'entrepôt peut contenir
public int MaxWeight { get; set; }
// Poids actuel stocké
public int Current { get; set; }
// Poids minimal souhaité
public int MinWeight { get; set; }
// Adresse de l'entrepôt
public string Adress { get; set; }
// Code postal
public int ZipCode { get; set; }
// Ville
public string City { get; set; }
// Liste des produits à mettre à jour dans cet entrepôt
public List<UpdateWarehouseProductDto>? Products { get; set; }
}
// DTO pour mettre à jour la quantité d'un produit dans un entrepôt
public class UpdateWarehouseProductDto
{
// Identifiant du produit
public int ProductId { get; set; }
// Nouvelle quantité du produit dans l'entrepôt
public int Quantity { get; set; }
}
}

View File

@@ -1,46 +0,0 @@
namespace API.DTO.Warehouse.Response
{
// DTO pour la lecture d'un entrepôt
public class GetWarehouseDto
{
// Identifiant de l'entrepôt
public int Id { get; set; }
// Nom de l'entrepôt
public string Name { get; set; }
// Poids maximal que l'entrepôt peut contenir
public int MaxWeight { get; set; }
// Poids actuellement stocké
public int Current { get; set; }
// Poids minimal souhaité
public int MinWeight { get; set; }
// Adresse de l'entrepôt
public string Adress { get; set; }
// Code postal
public int ZipCode { get; set; }
// Ville
public string City { get; set; }
// Liste des produits stockés dans l'entrepôt
public List<WarehouseProductDto>? Products { get; set; }
}
// DTO pour la lecture d'un produit dans un entrepôt
public class WarehouseProductDto
{
// Identifiant du produit
public int ProductId { get; set; }
// Nom du produit
public string? ProductName { get; set; }
// Quantité du produit dans l'entrepôt
public int Quantity { get; set; }
}
}

View File

@@ -1,35 +0,0 @@
using API.DTO.Brand.Response;
using FastEndpoints;
using PyroFetes.DTO.Brand.Request;
namespace PyroFetes.Endpoints.Brand;
public class CreateBrandEndpoint(PyroFetesDbContext pyrofetesdbcontext) : Endpoint<CreateBrandDto, GetBrandDto> //Instanciation d'une connexion à la bdd dans un endpoint, utilise l'élément de requête CreateBrandDto et l'élement de réponse GetBrandDto
{
public override void Configure() //Configuration de l'endpoint
{
Post("/api/brands"); //Créer une marque
AllowAnonymous(); //Autorise l'accès sans authentification
}
public override async Task HandleAsync(CreateBrandDto req, CancellationToken ct)
{
Models.Brand brand = new () //Création d'un nom rentré par l'utilisateur
{
Name = req.Name
};
pyrofetesdbcontext.Brands.Add(brand); //Ajout de la marque à la bdd
await pyrofetesdbcontext.SaveChangesAsync(ct); //Sauvegarde de la marque dans la bdd
Console.WriteLine("Marque créé avec succès !");
GetBrandDto responseDto = new () //Renvoie le nom
{
Name = req.Name
};
await Send.OkAsync(responseDto, ct); //Réponse au client
}
}

View File

@@ -1,38 +0,0 @@
using FastEndpoints;
using Microsoft.EntityFrameworkCore;
namespace PyroFetes.Endpoints.Brand;
public class DeleteBrandRequest
{
public int Id { get; set; } //Création d'un Id
}
public class DeleteBrandEndpoint(PyroFetesDbContext pyrofetesdbcontext) : Endpoint<DeleteBrandRequest> //Instanciation d'une connexion à la bdd dans un endpoint, utilise l'élément de requête DeleteBrandDto.
{
public override void Configure() //Configuration de l'endpoint
{
Delete("/api/brands/{@id}", x => new { x.Id }); //Supprime une marque
AllowAnonymous(); //Autorise l'accès sans authentification
}
public override async Task HandleAsync(DeleteBrandRequest req, CancellationToken ct)
{
Models.Brand? brandToDelete = await pyrofetesdbcontext //Récupère une marque dans la bdd et le stocke dans brandToDelete
.Brands //Recherche la couleur dans la table Colors
.SingleOrDefaultAsync(a => a.Id == req.Id, cancellationToken: ct); //Recherche une couleur dont l'id correspond à req.Id
if (brandToDelete == null)
{
Console.WriteLine($"Aucune marque avec l'ID {req.Id} trouvé.");
await Send.NotFoundAsync(ct); //Renvoie une erreur 404
return; //Arrêt de la méthode
}
pyrofetesdbcontext.Brands.Remove(brandToDelete); //Supprime la marque de la bdd
await pyrofetesdbcontext.SaveChangesAsync(ct); //Sauvegarde de la marque dans la bdd
await Send.NoContentAsync(ct); //Renvoie une réponse réussite 204
}
}

View File

@@ -1,28 +0,0 @@
using API.DTO.Brand.Response;
using FastEndpoints;
using Microsoft.EntityFrameworkCore;
namespace PyroFetes.Endpoints.Brand;
public class GetAllBrandsEndpoint(PyroFetesDbContext pyrofetesdbcontext) : EndpointWithoutRequest<List<GetBrandDto>>
{
public override void Configure()
{
Get("/api/brands"); //Endpoint qui affiche toutes les marques
AllowAnonymous(); //Autorise l'accès sans authentification
}
public override async Task HandleAsync(CancellationToken ct)
{
List<GetBrandDto> responseDto = await pyrofetesdbcontext.Brands //Création d'une liste qui récupère toutes les marques dans la bdd
.Select(a => new GetBrandDto //Sélectionne dans la liste chaque marque
{
Id = a.Id, //Affiche l'id
Name = a.Name, //Affiche le nom
}
).ToListAsync(ct); //Retourne la liste de marque
await Send.OkAsync(responseDto, ct); //Envoie de la réponse réussite 200 au client
}
}

View File

@@ -1,42 +0,0 @@
using API.DTO.Brand.Response;
using FastEndpoints;
using Microsoft.EntityFrameworkCore;
namespace PyroFetes.Endpoints.Brand;
public class GetBrandRequest
{
public int Id { get; set; }
}
public class GetBrandEndpoint(PyroFetesDbContext pyrofetesdbcontext) :Endpoint<GetBrandRequest, GetBrandDto>
{
public override void Configure()
{
Get("/api/brands/{@id}", x => new { x.Id }); //endpoint qui affiche la marque en fonction de l'id
AllowAnonymous(); //Autorise l'accès sans authentification
}
public override async Task HandleAsync(GetBrandRequest req, CancellationToken ct)
{
Models.Brand? brand = await pyrofetesdbcontext //Récupère la table marque dans la bdd
.Brands
.SingleOrDefaultAsync(a => a.Id == req.Id, cancellationToken: ct); //récupère l'id
if (brand == null)
{
Console.WriteLine($"Aucune marque avec l'ID {req.Id} trouvé.");
await Send.NotFoundAsync(ct); //Renvoie une erreur 404
return; //Arrêt de la méthode
}
GetBrandDto responseDto = new() //renvoie l'id et le nom
{
Id = req.Id, //Affiche l'id
Name = brand.Name //Affiche le nom
};
await Send.OkAsync(responseDto, ct); //Envoie de la réponse réussite 200 au client
}
}

View File

@@ -1,34 +0,0 @@
using API.DTO.Brand.Response;
using FastEndpoints;
using PyroFetes.DTO.Brand.Request;
namespace PyroFetes.Endpoints.Brand;
public class UpdateBrandEndpoint(PyroFetesDbContext pyrofetesdbcontext) : Endpoint<UpdateBrandDto, GetBrandDto>
{
public override void Configure()
{
Put("/api/brands/{Id}"); //Met à jour la marque en fonction de l'id
AllowAnonymous(); //Autorise l'accès sans authentification
}
public override async Task HandleAsync(UpdateBrandDto req, CancellationToken ct)
{
Models.Brand brand = new() //Met à jour la marque
{
Name = req.Name
};
pyrofetesdbcontext.Add(brand); //ajoute la marque dans la bdd
await pyrofetesdbcontext.SaveChangesAsync(ct); //Sauvegarde les changements
GetBrandDto response = new() //renvoie l'id et le nom
{
Id = req.Id,
Name = req.Name
};
await Send.OkAsync(response, ct); //Envoie de la réponse réussite 200 au client
}
}

View File

@@ -1,35 +0,0 @@
using API.DTO.Classification.Request;
using API.DTO.Classification.Response;
using FastEndpoints;
namespace PyroFetes.Endpoints.Classification;
public class CreateClassificationEndpoint(PyroFetesDbContext pyrofetesdbcontext) : Endpoint<CreateClassificationDto, GetClassificationDto> //Instanciation d'une connexion à la bdd dans un endpoint, utilise l'élément de requête CreateClassificationDto et l'élement de réponse GetClassificationDto
{
public override void Configure() //Configuration de l'endpoint
{
Post("/api/classifications"); //Créer une classification
AllowAnonymous(); //Autorise l'accès sans authentification
}
public override async Task HandleAsync(CreateClassificationDto req, CancellationToken ct)
{
Models.Classification classification = new () //Création d'un label rentré par l'utilisateur
{
Label = req.Label
};
pyrofetesdbcontext.Classifications.Add(classification); //Ajout de la classification à la bdd
await pyrofetesdbcontext.SaveChangesAsync(ct); //Sauvegarde de la classification dans la bdd
Console.WriteLine("Classification créée avec succès !");
GetClassificationDto responseDto = new () //Renvoie le label de la classification
{
Label = req.Label
};
await Send.OkAsync(responseDto, ct); //Réponse au client
}
}

View File

@@ -1,38 +0,0 @@
using FastEndpoints;
using Microsoft.EntityFrameworkCore;
namespace PyroFetes.Endpoints.Classification;
public class DeleteClassificationRequest
{
public int Id { get; set; }
}
public class DeleteClassificationEndpoint(PyroFetesDbContext libraryDbContext) : Endpoint<DeleteClassificationRequest>
{
public override void Configure()
{
Delete("/api/classifications/{@id}", x => new { x.Id }); //Supprime une classification en fonction de l'id
AllowAnonymous(); //Autorise l'accès sans authentification
}
public override async Task HandleAsync(DeleteClassificationRequest req, CancellationToken ct)
{
Models.Classification? classificationToDelete = await libraryDbContext //Récupère une classification dans la bdd et le stocke dans classificationToDelete
.Classifications //Recherche la classification dans la table Classifications
.SingleOrDefaultAsync(a => a.Id == req.Id, cancellationToken: ct); //Recherche une classification dont l'id correspond à req.Id
if (classificationToDelete == null)
{
Console.WriteLine($"Aucune classification avec l'ID {req.Id} trouvé.");
await Send.NotFoundAsync(ct); //Renvoie une erreur 404
return; //Arrêt de la méthode
}
libraryDbContext.Classifications.Remove(classificationToDelete); //Supprime la classification dans la bdd
await libraryDbContext.SaveChangesAsync(ct); //Sauvegarde de la classification dans la bdd
await Send.NoContentAsync(ct); //Renvoie une réponse réussite 204
}
}

View File

@@ -1,28 +0,0 @@
using API.DTO.Classification.Response;
using FastEndpoints;
using Microsoft.EntityFrameworkCore;
namespace PyroFetes.Endpoints.Classification;
public class GetAllClassificationsEndpoint(PyroFetesDbContext pyrofetesdbcontext) : EndpointWithoutRequest<List<GetClassificationDto>>
{
public override void Configure()
{
Get("/api/classifications"); //Endpoint qui affiche toutes les classifications
AllowAnonymous(); //Autorise l'accès sans authentification
}
public override async Task HandleAsync(CancellationToken ct)
{
List<GetClassificationDto> responseDto = await pyrofetesdbcontext.Classifications //Création d'une liste qui récupère toutes les classifications dans la bdd
.Select(a => new GetClassificationDto //Sélectionne dans la liste chaque classification
{
Id = a.Id, //Récupère l'id
Label = a.Label, //Récupère le label
}
).ToListAsync(ct); //Retourne la liste de classification
await Send.OkAsync(responseDto, ct); //Envoie de la réponse réussite 200 au client
}
}

View File

@@ -1,42 +0,0 @@
using API.DTO.Classification.Response;
using FastEndpoints;
using Microsoft.EntityFrameworkCore;
namespace PyroFetes.Endpoints.Classification;
public class GetClassificationRequest
{
public int Id { get; set; }
}
public class GetClassificationEndpoint(PyroFetesDbContext pyrofetesdbcontext) :Endpoint<GetClassificationRequest, GetClassificationDto>
{
public override void Configure()
{
Get("/api/classifications/{@id}", x => new { x.Id }); //endpoint qui affiche la classification en fonction de l'id
AllowAnonymous(); //Autorise l'accès sans authentification
}
public override async Task HandleAsync(GetClassificationRequest req, CancellationToken ct)
{
Models.Classification? classification = await pyrofetesdbcontext //Récupère la table marque dans la bdd
.Classifications
.SingleOrDefaultAsync(a => a.Id == req.Id, cancellationToken: ct); //récupère l'id
if (classification == null)
{
Console.WriteLine($"Aucune classification avec l'ID {req.Id} trouvé.");
await Send.NotFoundAsync(ct); //Renvoie une erreur 404
return; //Arrêt de la méthode
}
GetClassificationDto responseDto = new()
{
Id = req.Id, //Affiche l'id
Label = classification.Label //Affiche le nom
};
await Send.OkAsync(responseDto, ct); //Envoie de la réponse réussite 200 au client
}
}

View File

@@ -1,34 +0,0 @@
using API.DTO.Classification.Request;
using API.DTO.Classification.Response;
using FastEndpoints;
namespace PyroFetes.Endpoints.Classification;
public class UpdateClassificationEndpoint(PyroFetesDbContext pyrofetesdbcontext) : Endpoint<UpdateClassificationDto, GetClassificationDto>
{
public override void Configure()
{
Put("/api/classifications"); //Met à jour la classification en fonction de l'id
AllowAnonymous(); //Autorise l'accès sans authentification
}
public override async Task HandleAsync(UpdateClassificationDto req, CancellationToken ct)
{
Models.Classification classification = new() //Met à jour la classification
{
Label = req.Label
};
pyrofetesdbcontext.Add(classification); //ajoute la classification dans la bdd
await pyrofetesdbcontext.SaveChangesAsync(ct); //Sauvegarde les changements
GetClassificationDto response = new() //renvoie l'id et le nom
{
Id = req.Id,
Label = req.Label
};
await Send.OkAsync(response, ct); //Envoie de la réponse réussite 200 au client
}
}

View File

@@ -1,36 +0,0 @@
using API.DTO.Color.Request;
using API.DTO.Color.Response;
using FastEndpoints;
using PyroFetes;
namespace API.Endpoints.Color;
public class CreateColorEndpoint(PyroFetesDbContext pyroFetesDbContext) : Endpoint<CreateColorDto, GetColorDto> //Instanciation d'une connexion à la bdd dans un endpoint, utilise l'élément de requête CreateColorDto et l'élement de réponse GetColorDto
{
public override void Configure() //Configuration de l'endpoint
{
Post("Api/colors"); //Création d'un endpoint pour créer une couleur avec les données de CreateColorDto
AllowAnonymous(); //Laisser passer les requêtes non authentifiées
}
public override async Task HandleAsync(CreateColorDto req, CancellationToken ct) //La méthode HandleAsync est appelée lorsqu'une requête est envoyée à l'endpoint
{
PyroFetes.Models.Color color = new() //Création d'un label rentré par l'utilisateur
{
Label = req.Label,
};
pyroFetesDbContext.Colors.Add(color);
await pyroFetesDbContext.SaveChangesAsync(ct);
Console.WriteLine("Added Color");
GetColorDto responseDto = new()
{
Id = color.Id,
Label = req.Label,
};
await Send.OkAsync(responseDto, ct);
}
}

View File

@@ -1,37 +0,0 @@
using FastEndpoints;
using Microsoft.EntityFrameworkCore;
namespace PyroFetes.Endpoints.Color;
public class DeleteColorRequest //Création d'une classe DeleteColorRequest
{
public int Id { get; set; } //Création d'un Id
}
public class DeleteColorEndpoint(PyroFetesDbContext pyrofetesdbcontext) : Endpoint<DeleteColorRequest> //Instanciation d'une connexion à la bdd dans un endpoint, utilise l'élément de requête DeleteColorDto.
{
public override void Configure() //Configuration de l'endpoint
{
Delete("Api/colors/{@id}", x => new { x.Id }); //endpoint qui supprime une couleur grâce à son id
AllowAnonymous(); //Ignorer les requêtes non authentifiées
}
public override async Task HandleAsync(DeleteColorRequest req, CancellationToken ct) //Méthode asynchrone qui traite la suppression de la couleur
{
Models.Color? colorToDelete = await pyrofetesdbcontext //Récupère une couleur dans la bdd et le stocke dans colorToDelete
.Colors //Recherche la couleur dans la table Colors
.SingleOrDefaultAsync(a => a.Id == req.Id, cancellationToken: ct); //Recherche une couleur dont l'id correspond à req.Id
if (colorToDelete == null) //Si la couleur n'est pas trouvé
{
Console.WriteLine($"Aucune couleur avec l'ID {req.Id} trouvé.");
await Send.NotFoundAsync(ct); //Renvoie une erreur 404
return; //Arrêt de la méthode
}
pyrofetesdbcontext.Colors.Remove(colorToDelete); //Supprime la couleur dans la bdd
await pyrofetesdbcontext.SaveChangesAsync(ct); //Sauvegarde les changements effectués dans la bdd
await Send.NoContentAsync(ct); //Renvoie une réponse réussite 204
}
}

View File

@@ -1,26 +0,0 @@
using API.DTO.Color.Response;
using FastEndpoints;
using Microsoft.EntityFrameworkCore;
namespace PyroFetes.Endpoints.Color;
public class GetAllColorsEndpoint(PyroFetesDbContext pyrofetesdbcontext) : EndpointWithoutRequest<List<GetColorDto>>
{
public override void Configure() //Configuration de l'endpoint
{
Get("Api/colors"); //Endpoint qui affiche toutes les couleurs
AllowAnonymous(); //Ignorer les requêtes non authentifiées
}
public override async Task HandleAsync(CancellationToken ct)
{
List<GetColorDto> responseDto = await pyrofetesdbcontext.Colors //Création d'une liste qui récupère toutes les couleurs dans la bdd
.Select(a => new GetColorDto //Sélectionne dans la liste chaque couleur
{
Id = a.Id, //Récupère l'id
Label = a.Label, //Récupère le label
}
).ToListAsync(ct); //Retourne la liste de couleur
await Send.OkAsync(responseDto, ct); //Envoie de la réponse réussite 200 au client
}
}

View File

@@ -1,40 +0,0 @@
using API.DTO.Color.Response;
using FastEndpoints;
using Microsoft.EntityFrameworkCore;
namespace PyroFetes.Endpoints.Color;
public class GetColorRequest
{
public int Id { get; set; }
}
public class GetColorEndpoint(PyroFetesDbContext pyrofetesdbcontext) : Endpoint<GetColorRequest, GetColorDto>
{
public override void Configure()
{
Get("Api/colors/{@id}", x => new { x.Id}); //endpoint qui récupère une couleur grâce à son id
AllowAnonymous(); //Autorise l'accès sans authentification
}
public override async Task HandleAsync(GetColorRequest req, CancellationToken ct) //Méthode asynchrone qui traite la récupération de la couleur
{
Models.Color? color = await pyrofetesdbcontext //Récupère une couleur dans la bdd et le stocke dans color
.Colors //Recherche la couleur dans la table Colors
.SingleOrDefaultAsync(x => x.Id == req.Id, cancellationToken: ct); //Recherche une couleur dont l'id correspond à req.Id
if (color == null) //Si la couleur n'est pas trouvé
{
Console.WriteLine("Aucune couleur avec l'ID {req.Id} trouvé."); //Affiche aucune couleur avec l'id ... trouvé
await Send.NotFoundAsync(ct); //Renvoie une erreur 404
return; //Arrêt de la méthode
}
GetColorDto responseDto = new() //Constuire l'objet de réponse pour retourner les informations à l'utilisateur
{
Id = color.Id, //Affiche l'id lors de la réponse
Label = color.Label, //Affiche le label lors de la réponse
};
await Send.OkAsync(responseDto, ct); //Envoie de la réponse réussite 200 au client
}
}

View File

@@ -1,41 +0,0 @@
using API.DTO.Color.Request;
using API.DTO.Color.Response;
using FastEndpoints;
using Microsoft.EntityFrameworkCore;
namespace PyroFetes.Endpoints.Color;
public class UpdateColorEndpoint(PyroFetesDbContext pyrofetesdbcontext) : Endpoint<UpdateColorDto, GetColorDto>
{
public override void Configure() //Configuration de l'endpoint
{
Put("Api/colors/{@id}", x => new { x.Id }); //Création d'un endpoint qui modifie la couleur grâce à son id
AllowAnonymous(); //Ignorer les requêtes non authentifiées
}
public override async Task HandleAsync(UpdateColorDto req, CancellationToken ct)
{
Models.Color? colorToEdit = await pyrofetesdbcontext //Récupère une couleur dans la bdd et le stocke dans colorToEdit
.Colors //Recherche la couleur dans la table Colors
.SingleOrDefaultAsync(x => x.Id == req.Id, cancellationToken: ct); //Recherche une couleur dont l'id correspond à req.Id
if (colorToEdit == null) //Si la couleur n'est pas trouvé
{
Console.WriteLine("Aucune couleur avec l'id {req.Id} trouvé."); //Afficher aucune couleur avec l'id ... trouvé
await Send.NotFoundAsync(ct); //Renvoie une erreur 404
return; //Arrêt de la méthode
}
colorToEdit.Label = req.Label; //Modification du label
await pyrofetesdbcontext.SaveChangesAsync(ct); //Sauvegarde les changements effectués dans la bdd
GetColorDto responseDto = new() //Constuire l'objet de réponse pour retourner l'id et le label de la nouvelle couleur
{
Id = req.Id, //Affiche l'id
Label = req.Label, //Affiche le label
};
await Send.OkAsync(responseDto, ct); //Envoie de la réponse réussite 200 au client
}
}

Some files were not shown because too many files have changed in this diff Show More