From 27d1bb680ba5241b634ca79750252294565be629 Mon Sep 17 00:00:00 2001 From: Oscar Morales Date: Fri, 8 Aug 2025 11:13:25 -0600 Subject: [PATCH] Add physical delete --- .../UseCases/Tag/Input/DeleteTagRequest.cs | 14 ++++++++ .../UseCases/Tag/TagHandler.cs | 34 ++++++++++++++++++- .../Tag/Validator/DeleteTagValidator.cs | 13 +++++++ .../Input/DeleteTagOverrideRequest.cs | 14 ++++++++ .../TagOverride/TagOverrideHandler.cs | 34 ++++++++++++++++++- .../Validator/DeleteTagOverrideValidator.cs | 13 +++++++ .../TagType/Input/DeleteTagTypeRequest.cs | 14 ++++++++ .../UseCases/TagType/TagTypeHandler.cs | 34 ++++++++++++++++++- .../Validator/DeleteTagTypeValidator.cs | 13 +++++++ .../Clients/IInventoryServiceClient.cs | 9 +++++ .../Controllers/TagController.cs | 22 ++++++++++++ .../Controllers/TagOverrideController.cs | 21 ++++++++++++ .../Controllers/TagTypeController.cs | 21 ++++++++++++ .../Extensions/ServiceCollectionExtension.cs | 12 +++++++ 14 files changed, 265 insertions(+), 3 deletions(-) create mode 100644 Core.Inventory.Application/UseCases/Tag/Input/DeleteTagRequest.cs create mode 100644 Core.Inventory.Application/UseCases/Tag/Validator/DeleteTagValidator.cs create mode 100644 Core.Inventory.Application/UseCases/TagOverride/Input/DeleteTagOverrideRequest.cs create mode 100644 Core.Inventory.Application/UseCases/TagOverride/Validator/DeleteTagOverrideValidator.cs create mode 100644 Core.Inventory.Application/UseCases/TagType/Input/DeleteTagTypeRequest.cs create mode 100644 Core.Inventory.Application/UseCases/TagType/Validator/DeleteTagTypeValidator.cs diff --git a/Core.Inventory.Application/UseCases/Tag/Input/DeleteTagRequest.cs b/Core.Inventory.Application/UseCases/Tag/Input/DeleteTagRequest.cs new file mode 100644 index 0000000..a0d2d07 --- /dev/null +++ b/Core.Inventory.Application/UseCases/Tag/Input/DeleteTagRequest.cs @@ -0,0 +1,14 @@ +using Lib.Architecture.BuildingBlocks; + +namespace Core.Inventory.Application.UseCases.Tag.Input +{ + public class DeleteTagRequest : Notificator, ICommand + { + public string Id { get; set; } = null!; + + public bool Validate() + { + return Id != null; + } + } +} \ No newline at end of file diff --git a/Core.Inventory.Application/UseCases/Tag/TagHandler.cs b/Core.Inventory.Application/UseCases/Tag/TagHandler.cs index f1b02b3..f5d1bb1 100644 --- a/Core.Inventory.Application/UseCases/Tag/TagHandler.cs +++ b/Core.Inventory.Application/UseCases/Tag/TagHandler.cs @@ -17,7 +17,8 @@ namespace Core.Inventory.Application.UseCases.Tag IComponentHandler, IComponentHandler, IComponentHandler, - IComponentHandler + IComponentHandler, + IComponentHandler { private readonly ITagPort _port; private readonly IValidator _changeTagStatusValidator; @@ -25,6 +26,7 @@ namespace Core.Inventory.Application.UseCases.Tag private readonly IValidator _updateTagValidator; private readonly IValidator _TagsByListValidator; private readonly IInventoryServiceClient _inventoryServiceClient; + private readonly IValidator _deleteTagValidator; public TagHandler( ITagPort port, @@ -32,6 +34,7 @@ namespace Core.Inventory.Application.UseCases.Tag IValidator registerTagValidator, IValidator updateTagValidator, IValidator TagsByListValidator, + IValidator deleteTagValidator, IInventoryServiceClient inventoryDALService) { _port = port ?? throw new ArgumentNullException(nameof(port)); @@ -40,6 +43,7 @@ namespace Core.Inventory.Application.UseCases.Tag _updateTagValidator = updateTagValidator ?? throw new ArgumentNullException(nameof(updateTagValidator)); _inventoryServiceClient = inventoryDALService ?? throw new ArgumentNullException(nameof(inventoryDALService)); _TagsByListValidator = TagsByListValidator ?? throw new ArgumentNullException(nameof(TagsByListValidator)); + _deleteTagValidator = deleteTagValidator ?? throw new ArgumentNullException(nameof(deleteTagValidator)); } public async ValueTask ExecuteAsync(GetTagRequest command, CancellationToken cancellationToken = default) @@ -262,5 +266,33 @@ namespace Core.Inventory.Application.UseCases.Tag ApiResponseHelper.EvaluatePort(ex, _port); } } + + public async ValueTask ExecuteAsync(DeleteTagRequest command, CancellationToken cancellationToken = default) + { + try + { + ArgumentNullException.ThrowIfNull(command); + + if (!command.IsValid(_deleteTagValidator)) + { + _port.ValidationErrors(command.Notifications); + return; + } + + var result = await _inventoryServiceClient.DeleteTagAsync(command.Id, cancellationToken).ConfigureAwait(false); + + if (result == null) + { + _port.NoContentSuccess(); + return; + } + + _port.Success(result); + } + catch (Exception ex) + { + ApiResponseHelper.EvaluatePort(ex, _port); + } + } } } diff --git a/Core.Inventory.Application/UseCases/Tag/Validator/DeleteTagValidator.cs b/Core.Inventory.Application/UseCases/Tag/Validator/DeleteTagValidator.cs new file mode 100644 index 0000000..e25e484 --- /dev/null +++ b/Core.Inventory.Application/UseCases/Tag/Validator/DeleteTagValidator.cs @@ -0,0 +1,13 @@ +using Core.Inventory.Application.UseCases.Tag.Input; +using FluentValidation; + +namespace Core.Inventory.Application.UseCases.Tag.Validator +{ + public class DeleteTagValidator : AbstractValidator + { + public DeleteTagValidator() + { + RuleFor(i => i.Id).NotEmpty().NotNull().OverridePropertyName(x => x.Id).WithName("Tag Id").WithMessage("Tag Id is Obligatory."); + } + } +} \ No newline at end of file diff --git a/Core.Inventory.Application/UseCases/TagOverride/Input/DeleteTagOverrideRequest.cs b/Core.Inventory.Application/UseCases/TagOverride/Input/DeleteTagOverrideRequest.cs new file mode 100644 index 0000000..f4c85b8 --- /dev/null +++ b/Core.Inventory.Application/UseCases/TagOverride/Input/DeleteTagOverrideRequest.cs @@ -0,0 +1,14 @@ +using Lib.Architecture.BuildingBlocks; + +namespace Core.Inventory.Application.UseCases.TagOverride.Input +{ + public class DeleteTagOverrideRequest : Notificator, ICommand + { + public string Id { get; set; } = null!; + + public bool Validate() + { + return Id != null; + } + } +} \ No newline at end of file diff --git a/Core.Inventory.Application/UseCases/TagOverride/TagOverrideHandler.cs b/Core.Inventory.Application/UseCases/TagOverride/TagOverrideHandler.cs index 64351e3..d3ef47b 100644 --- a/Core.Inventory.Application/UseCases/TagOverride/TagOverrideHandler.cs +++ b/Core.Inventory.Application/UseCases/TagOverride/TagOverrideHandler.cs @@ -15,7 +15,8 @@ namespace Core.Inventory.Application.UseCases.TagOverride IComponentHandler, IComponentHandler, IComponentHandler, - IComponentHandler + IComponentHandler, + IComponentHandler { private readonly ITagOverridePort _port; private readonly IValidator _changeTagOverrideStatusValidator; @@ -23,6 +24,7 @@ namespace Core.Inventory.Application.UseCases.TagOverride private readonly IValidator _updateTagOverrideValidator; private readonly IValidator _TagOverridesByListValidator; private readonly IInventoryServiceClient _inventoryServiceClient; + private readonly IValidator _deleteTagOverrideValidator; public TagOverrideHandler( ITagOverridePort port, @@ -30,6 +32,7 @@ namespace Core.Inventory.Application.UseCases.TagOverride IValidator registerTagOverrideValidator, IValidator updateTagOverrideValidator, IValidator TagOverridesByListValidator, + IValidator deleteTagOverrideValidator, IInventoryServiceClient inventoryDALService) { _port = port ?? throw new ArgumentNullException(nameof(port)); @@ -38,6 +41,7 @@ namespace Core.Inventory.Application.UseCases.TagOverride _updateTagOverrideValidator = updateTagOverrideValidator ?? throw new ArgumentNullException(nameof(updateTagOverrideValidator)); _inventoryServiceClient = inventoryDALService ?? throw new ArgumentNullException(nameof(inventoryDALService)); _TagOverridesByListValidator = TagOverridesByListValidator ?? throw new ArgumentNullException(nameof(TagOverridesByListValidator)); + _deleteTagOverrideValidator = deleteTagOverrideValidator ?? throw new ArgumentNullException(nameof(deleteTagOverrideValidator)); } public async ValueTask ExecuteAsync(GetTagOverrideRequest command, CancellationToken cancellationToken = default) @@ -208,5 +212,33 @@ namespace Core.Inventory.Application.UseCases.TagOverride ApiResponseHelper.EvaluatePort(ex, _port); } } + + public async ValueTask ExecuteAsync(DeleteTagOverrideRequest command, CancellationToken cancellationToken = default) + { + try + { + ArgumentNullException.ThrowIfNull(command); + + if (!command.IsValid(_deleteTagOverrideValidator)) + { + _port.ValidationErrors(command.Notifications); + return; + } + + var result = await _inventoryServiceClient.DeleteTagOverrideAsync(command.Id, cancellationToken).ConfigureAwait(false); + + if (result == null) + { + _port.NoContentSuccess(); + return; + } + + _port.Success(result); + } + catch (Exception ex) + { + ApiResponseHelper.EvaluatePort(ex, _port); + } + } } } diff --git a/Core.Inventory.Application/UseCases/TagOverride/Validator/DeleteTagOverrideValidator.cs b/Core.Inventory.Application/UseCases/TagOverride/Validator/DeleteTagOverrideValidator.cs new file mode 100644 index 0000000..5c49832 --- /dev/null +++ b/Core.Inventory.Application/UseCases/TagOverride/Validator/DeleteTagOverrideValidator.cs @@ -0,0 +1,13 @@ +using Core.Inventory.Application.UseCases.TagOverride.Input; +using FluentValidation; + +namespace Core.Inventory.Application.UseCases.TagOverride.Validator +{ + public class DeleteTagOverrideValidator : AbstractValidator + { + public DeleteTagOverrideValidator() + { + RuleFor(i => i.Id).NotEmpty().NotNull().OverridePropertyName(x => x.Id).WithName("TagOverride Id").WithMessage("TagOverride Id is Obligatory."); + } + } +} \ No newline at end of file diff --git a/Core.Inventory.Application/UseCases/TagType/Input/DeleteTagTypeRequest.cs b/Core.Inventory.Application/UseCases/TagType/Input/DeleteTagTypeRequest.cs new file mode 100644 index 0000000..18c01db --- /dev/null +++ b/Core.Inventory.Application/UseCases/TagType/Input/DeleteTagTypeRequest.cs @@ -0,0 +1,14 @@ +using Lib.Architecture.BuildingBlocks; + +namespace Core.Inventory.Application.UseCases.TagType.Input +{ + public class DeleteTagTypeRequest : Notificator, ICommand + { + public string Id { get; set; } = null!; + + public bool Validate() + { + return Id != null; + } + } +} \ No newline at end of file diff --git a/Core.Inventory.Application/UseCases/TagType/TagTypeHandler.cs b/Core.Inventory.Application/UseCases/TagType/TagTypeHandler.cs index c3f4760..b5bc364 100644 --- a/Core.Inventory.Application/UseCases/TagType/TagTypeHandler.cs +++ b/Core.Inventory.Application/UseCases/TagType/TagTypeHandler.cs @@ -15,13 +15,15 @@ namespace Core.Inventory.Application.UseCases.TagType IComponentHandler, IComponentHandler, IComponentHandler, - IComponentHandler + IComponentHandler, + IComponentHandler { private readonly ITagTypePort _port; private readonly IValidator _changeTagTypeStatusValidator; private readonly IValidator _registerTagTypeValidator; private readonly IValidator _updateTagTypeValidator; private readonly IValidator _TagTypesByListValidator; + private readonly IValidator _deleteTagTypeValidator; private readonly IInventoryServiceClient _inventoryServiceClient; public TagTypeHandler( @@ -30,6 +32,7 @@ namespace Core.Inventory.Application.UseCases.TagType IValidator registerTagTypeValidator, IValidator updateTagTypeValidator, IValidator TagTypesByListValidator, + IValidator deleteTagTypeValidator, IInventoryServiceClient inventoryDALService) { _port = port ?? throw new ArgumentNullException(nameof(port)); @@ -38,6 +41,7 @@ namespace Core.Inventory.Application.UseCases.TagType _updateTagTypeValidator = updateTagTypeValidator ?? throw new ArgumentNullException(nameof(updateTagTypeValidator)); _inventoryServiceClient = inventoryDALService ?? throw new ArgumentNullException(nameof(inventoryDALService)); _TagTypesByListValidator = TagTypesByListValidator ?? throw new ArgumentNullException(nameof(TagTypesByListValidator)); + _deleteTagTypeValidator = deleteTagTypeValidator ?? throw new ArgumentNullException(nameof(deleteTagTypeValidator)); } public async ValueTask ExecuteAsync(GetTagTypeRequest command, CancellationToken cancellationToken = default) @@ -210,5 +214,33 @@ namespace Core.Inventory.Application.UseCases.TagType ApiResponseHelper.EvaluatePort(ex, _port); } } + + public async ValueTask ExecuteAsync(DeleteTagTypeRequest command, CancellationToken cancellationToken = default) + { + try + { + ArgumentNullException.ThrowIfNull(command); + + if (!command.IsValid(_deleteTagTypeValidator)) + { + _port.ValidationErrors(command.Notifications); + return; + } + + var result = await _inventoryServiceClient.DeleteTagTypeAsync(command.Id, cancellationToken).ConfigureAwait(false); + + if (result == null) + { + _port.NoContentSuccess(); + return; + } + + _port.Success(result); + } + catch (Exception ex) + { + ApiResponseHelper.EvaluatePort(ex, _port); + } + } } } diff --git a/Core.Inventory.Application/UseCases/TagType/Validator/DeleteTagTypeValidator.cs b/Core.Inventory.Application/UseCases/TagType/Validator/DeleteTagTypeValidator.cs new file mode 100644 index 0000000..c5ae6f6 --- /dev/null +++ b/Core.Inventory.Application/UseCases/TagType/Validator/DeleteTagTypeValidator.cs @@ -0,0 +1,13 @@ +using Core.Inventory.Application.UseCases.TagType.Input; +using FluentValidation; + +namespace Core.Inventory.Application.UseCases.TagType.Validator +{ + public class DeleteTagTypeValidator : AbstractValidator + { + public DeleteTagTypeValidator() + { + RuleFor(i => i.Id).NotEmpty().NotNull().OverridePropertyName(x => x.Id).WithName("TagType Id").WithMessage("TagType Id is Obligatory."); + } + } +} \ No newline at end of file diff --git a/Core.Inventory.External/Clients/IInventoryServiceClient.cs b/Core.Inventory.External/Clients/IInventoryServiceClient.cs index 529ae8b..2395c61 100644 --- a/Core.Inventory.External/Clients/IInventoryServiceClient.cs +++ b/Core.Inventory.External/Clients/IInventoryServiceClient.cs @@ -73,6 +73,9 @@ namespace Core.Inventory.External.Clients [Patch("/api/v1/TagType/{id}/{newStatus}/ChangeStatus")] Task ChangeStatusTagTypeAsync([FromRoute] string id, [FromRoute] StatusEnum newStatus, CancellationToken cancellationToken = default); + [Delete("/api/v1/TagType/{id}")] + Task DeleteTagTypeAsync([FromRoute] string id, CancellationToken cancellationToken = default); + #endregion #region Tag @@ -101,6 +104,9 @@ namespace Core.Inventory.External.Clients [Delete("/api/v1/Tag/{tagId}/ParentTags/{parentTagId}/Remove")] Task RemoveParentTagAsync([FromRoute] string tagId, [FromRoute] string parentTagId, CancellationToken cancellationToken = default); + [Delete("/api/v1/Tag/{id}")] + Task DeleteTagAsync([FromRoute] string id, CancellationToken cancellationToken = default); + #endregion #region TagOverride @@ -123,6 +129,9 @@ namespace Core.Inventory.External.Clients [Patch("/api/v1/TagOverride/{id}/{newStatus}/ChangeStatus")] Task ChangeStatusTagOverrideAsync([FromRoute] string id, [FromRoute] StatusEnum newStatus, CancellationToken cancellationToken = default); + [Delete("/api/v1/TagOverride/{id}")] + Task DeleteTagOverrideAsync([FromRoute] string id, CancellationToken cancellationToken = default); + #endregion #region Product diff --git a/Core.Inventory.Service.API/Controllers/TagController.cs b/Core.Inventory.Service.API/Controllers/TagController.cs index 88b21d5..fd8bfe1 100644 --- a/Core.Inventory.Service.API/Controllers/TagController.cs +++ b/Core.Inventory.Service.API/Controllers/TagController.cs @@ -2,6 +2,7 @@ using Core.Adapters.Lib; using Core.Inventory.Application.UseCases.Tag.Input; using Core.Inventory.Application.UseCases.Tag.Ports; +using Core.Inventory.Application.UseCases.TagType.Input; using Lib.Architecture.BuildingBlocks; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; @@ -26,6 +27,7 @@ namespace Core.Inventory.Service.API.Controllers private readonly IComponentHandler changeTagStatusHandler; private readonly IComponentHandler addParentTagToTagHandler; private readonly IComponentHandler removeParentTagFromTagUserHandler; + private readonly IComponentHandler deleteTagHandler; private readonly ITagPort port; /// @@ -40,6 +42,7 @@ namespace Core.Inventory.Service.API.Controllers IComponentHandler changeTagStatusHandler, IComponentHandler addParentTagToTagHandler, IComponentHandler removeParentTagFromTagUserHandler, + IComponentHandler deleteTagHandler, ITagPort port ) { @@ -51,6 +54,7 @@ namespace Core.Inventory.Service.API.Controllers this.getAllTagsByListHandler = getAllTagsByListHandler; this.addParentTagToTagHandler = addParentTagToTagHandler; this.removeParentTagFromTagUserHandler = removeParentTagFromTagUserHandler; + this.deleteTagHandler = deleteTagHandler; this.port = port; } @@ -235,5 +239,23 @@ namespace Core.Inventory.Service.API.Controllers return port.ViewModel; } + + /// + /// Deletes a full Tag by identifier. + /// + [HttpDelete("Delete")] + [ProducesResponseType(StatusCodes.Status200OK)] + [ProducesResponseType(StatusCodes.Status204NoContent)] + [ProducesResponseType(StatusCodes.Status401Unauthorized)] + [ProducesResponseType(typeof(Notification), StatusCodes.Status412PreconditionFailed)] + [ProducesResponseType(typeof(Notification), StatusCodes.Status422UnprocessableEntity)] + [ProducesResponseType(StatusCodes.Status500InternalServerError)] + [ProducesResponseType(StatusCodes.Status400BadRequest)] + public async Task UpdateTagAsync([FromBody] DeleteTagRequest request, CancellationToken cancellationToken = default) + { + await deleteTagHandler.ExecuteAsync(request, cancellationToken).ConfigureAwait(false); + + return port.ViewModel; + } } } diff --git a/Core.Inventory.Service.API/Controllers/TagOverrideController.cs b/Core.Inventory.Service.API/Controllers/TagOverrideController.cs index 3ccd475..3e7fe84 100644 --- a/Core.Inventory.Service.API/Controllers/TagOverrideController.cs +++ b/Core.Inventory.Service.API/Controllers/TagOverrideController.cs @@ -24,6 +24,7 @@ namespace Core.Inventory.Service.API.Controllers private readonly IComponentHandler createTagOverrideHandler; private readonly IComponentHandler updateTagOverrideHandler; private readonly IComponentHandler changeTagOverrideStatusHandler; + private readonly IComponentHandler deleteTagOverrideHandler; private readonly ITagOverridePort port; /// @@ -36,6 +37,7 @@ namespace Core.Inventory.Service.API.Controllers IComponentHandler createTagOverrideHandler, IComponentHandler updateTagOverrideHandler, IComponentHandler changeTagOverrideStatusHandler, + IComponentHandler deleteTagOverrideHandler, ITagOverridePort port ) { @@ -45,6 +47,7 @@ namespace Core.Inventory.Service.API.Controllers this.getAllTagOverridesHandler = getAllTagOverridesHandler; this.getTagOverrideHandler = getTagOverrideHandler; this.getAllTagOverridesByListHandler = getAllTagOverridesByListHandler; + this.deleteTagOverrideHandler = deleteTagOverrideHandler; this.port = port; } @@ -183,5 +186,23 @@ namespace Core.Inventory.Service.API.Controllers return port.ViewModel; } + + /// + /// Deletes a full TagOverride by identifier. + /// + [HttpDelete("Delete")] + [ProducesResponseType(StatusCodes.Status200OK)] + [ProducesResponseType(StatusCodes.Status204NoContent)] + [ProducesResponseType(StatusCodes.Status401Unauthorized)] + [ProducesResponseType(typeof(Notification), StatusCodes.Status412PreconditionFailed)] + [ProducesResponseType(typeof(Notification), StatusCodes.Status422UnprocessableEntity)] + [ProducesResponseType(StatusCodes.Status500InternalServerError)] + [ProducesResponseType(StatusCodes.Status400BadRequest)] + public async Task UpdateTagOverrideAsync([FromBody] DeleteTagOverrideRequest request, CancellationToken cancellationToken = default) + { + await deleteTagOverrideHandler.ExecuteAsync(request, cancellationToken).ConfigureAwait(false); + + return port.ViewModel; + } } } diff --git a/Core.Inventory.Service.API/Controllers/TagTypeController.cs b/Core.Inventory.Service.API/Controllers/TagTypeController.cs index 1011f30..1f2086d 100644 --- a/Core.Inventory.Service.API/Controllers/TagTypeController.cs +++ b/Core.Inventory.Service.API/Controllers/TagTypeController.cs @@ -24,6 +24,7 @@ namespace Core.Inventory.Service.API.Controllers private readonly IComponentHandler createTagTypeHandler; private readonly IComponentHandler updateTagTypeHandler; private readonly IComponentHandler changeTagTypeStatusHandler; + private readonly IComponentHandler deleteTagTypeHandler; private readonly ITagTypePort port; /// @@ -36,6 +37,7 @@ namespace Core.Inventory.Service.API.Controllers IComponentHandler createTagTypeHandler, IComponentHandler updateTagTypeHandler, IComponentHandler changeTagTypeStatusHandler, + IComponentHandler deleteTagTypeHandler, ITagTypePort port ) { @@ -45,6 +47,7 @@ namespace Core.Inventory.Service.API.Controllers this.getAllTagTypesHandler = getAllTagTypesHandler; this.getTagTypeHandler = getTagTypeHandler; this.getAllTagTypesByListHandler = getAllTagTypesByListHandler; + this.deleteTagTypeHandler = deleteTagTypeHandler; this.port = port; } @@ -183,5 +186,23 @@ namespace Core.Inventory.Service.API.Controllers return port.ViewModel; } + + /// + /// Deletes a full TagType by identifier. + /// + [HttpDelete("Delete")] + [ProducesResponseType(StatusCodes.Status200OK)] + [ProducesResponseType(StatusCodes.Status204NoContent)] + [ProducesResponseType(StatusCodes.Status401Unauthorized)] + [ProducesResponseType(typeof(Notification), StatusCodes.Status412PreconditionFailed)] + [ProducesResponseType(typeof(Notification), StatusCodes.Status422UnprocessableEntity)] + [ProducesResponseType(StatusCodes.Status500InternalServerError)] + [ProducesResponseType(StatusCodes.Status400BadRequest)] + public async Task UpdateTagTypeAsync([FromBody] DeleteTagTypeRequest request, CancellationToken cancellationToken = default) + { + await deleteTagTypeHandler.ExecuteAsync(request, cancellationToken).ConfigureAwait(false); + + return port.ViewModel; + } } } diff --git a/Core.Inventory.Service.API/Extensions/ServiceCollectionExtension.cs b/Core.Inventory.Service.API/Extensions/ServiceCollectionExtension.cs index ad5a437..5ebdde0 100644 --- a/Core.Inventory.Service.API/Extensions/ServiceCollectionExtension.cs +++ b/Core.Inventory.Service.API/Extensions/ServiceCollectionExtension.cs @@ -108,6 +108,10 @@ namespace Core.Inventory.Service.API.Extensions services.AddScoped, ChangeTagTypeStatusValidator>(); services.AddScoped, TagTypeHandler>(); + services.AddValidatorsFromAssemblyContaining(); + services.AddScoped, DeleteTagTypeValidator>(); + services.AddScoped, TagTypeHandler>(); + #endregion #region Tag Services @@ -135,6 +139,10 @@ namespace Core.Inventory.Service.API.Extensions services.AddScoped, TagHandler>(); services.AddScoped, TagHandler>(); + services.AddValidatorsFromAssemblyContaining(); + services.AddScoped, DeleteTagValidator>(); + services.AddScoped, TagHandler>(); + #endregion #region TagOverride Services @@ -159,6 +167,10 @@ namespace Core.Inventory.Service.API.Extensions services.AddScoped, ChangeTagOverrideStatusValidator>(); services.AddScoped, TagOverrideHandler>(); + services.AddValidatorsFromAssemblyContaining(); + services.AddScoped, DeleteTagOverrideValidator>(); + services.AddScoped, TagOverrideHandler>(); + #endregion #region Product Services