feat(application): Rubros commands/queries + RubroTreeBuilder + audit (CAT-001)
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
using SIGCM2.Application.Abstractions;
|
||||
using SIGCM2.Application.Abstractions.Persistence;
|
||||
using SIGCM2.Application.Rubros.Common;
|
||||
using SIGCM2.Application.Rubros.Dtos;
|
||||
|
||||
namespace SIGCM2.Application.Rubros.GetTree;
|
||||
|
||||
public sealed class GetRubroTreeQueryHandler : ICommandHandler<GetRubroTreeQuery, IReadOnlyList<RubroTreeNodeDto>>
|
||||
{
|
||||
private readonly IRubroRepository _repo;
|
||||
|
||||
public GetRubroTreeQueryHandler(IRubroRepository repo)
|
||||
{
|
||||
_repo = repo;
|
||||
}
|
||||
|
||||
public async Task<IReadOnlyList<RubroTreeNodeDto>> Handle(GetRubroTreeQuery query)
|
||||
{
|
||||
var all = await _repo.GetAllAsync(query.IncluirInactivos);
|
||||
return RubroTreeBuilder.Build(all, query.IncluirInactivos);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user