feat(adm-009): TipoDeIva + IngresosBrutos handlers, DTOs, DI registration

This commit is contained in:
2026-04-17 18:09:52 -03:00
parent 2cd25e1036
commit bd0c4deea7
47 changed files with 1134 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
using SIGCM2.Application.Abstractions;
using SIGCM2.Application.Abstractions.Persistence;
using SIGCM2.Application.IngresosBrutos.Dtos;
using SIGCM2.Domain.Exceptions;
namespace SIGCM2.Application.IngresosBrutos.GetById;
public sealed class GetIngresosBrutosByIdQueryHandler
: ICommandHandler<GetIngresosBrutosByIdQuery, IngresosBrutosDto>
{
private readonly IIngresosBrutosRepository _repo;
public GetIngresosBrutosByIdQueryHandler(IIngresosBrutosRepository repo)
{
_repo = repo;
}
public async Task<IngresosBrutosDto> Handle(GetIngresosBrutosByIdQuery query)
{
var entity = await _repo.GetByIdAsync(query.Id)
?? throw new IngresosBrutosNotFoundException(query.Id);
return IngresosBrutosMapper.ToDto(entity);
}
}