feat: Added Product controller and endpoints (Service Layer)

This commit is contained in:
2025-08-03 18:56:47 -06:00
parent fc093e8bff
commit c446fa652e
19 changed files with 654 additions and 2 deletions

View File

@@ -5,6 +5,11 @@ using Core.Inventory.Application.UseCases.Inventory.Input.Variant;
using Core.Inventory.Application.UseCases.Inventory.Ports;
using Core.Inventory.Application.UseCases.Inventory.Validator.Base;
using Core.Inventory.Application.UseCases.Inventory.Validator.Variant;
using Core.Inventory.Application.UseCases.Product;
using Core.Inventory.Application.UseCases.Product.Adapter;
using Core.Inventory.Application.UseCases.Product.Input;
using Core.Inventory.Application.UseCases.Product.Ports;
using Core.Inventory.Application.UseCases.Product.Validator;
using Core.Inventory.Application.UseCases.Tag;
using Core.Inventory.Application.UseCases.Tag.Adapter;
using Core.Inventory.Application.UseCases.Tag.Input;
@@ -127,6 +132,30 @@ namespace Core.Inventory.Service.API.Extensions
#endregion
#region Product Services
services.AddScoped<IProductPort, ProductPort>();
services.AddScoped<IComponentHandler<GetAllProductsRequest>, ProductHandler>();
services.AddScoped<IComponentHandler<GetProductRequest>, ProductHandler>();
services.AddValidatorsFromAssemblyContaining<GetAllProductsByListValidator>();
services.AddScoped<IValidator<GetAllProductsByListRequest>, GetAllProductsByListValidator>();
services.AddScoped<IComponentHandler<GetAllProductsByListRequest>, ProductHandler>();
services.AddValidatorsFromAssemblyContaining<CreateProductValidator>();
services.AddScoped<IValidator<CreateProductRequest>, CreateProductValidator>();
services.AddScoped<IComponentHandler<CreateProductRequest>, ProductHandler>();
services.AddValidatorsFromAssemblyContaining<UpdateProductValidator>();
services.AddScoped<IValidator<UpdateProductRequest>, UpdateProductValidator>();
services.AddScoped<IComponentHandler<UpdateProductRequest>, ProductHandler>();
services.AddValidatorsFromAssemblyContaining<ChangeProductStatusValidator>();
services.AddScoped<IValidator<ChangeProductStatusRequest>, ChangeProductStatusValidator>();
services.AddScoped<IComponentHandler<ChangeProductStatusRequest>, ProductHandler>();
#endregion
return services;
}
}