using Domain.Entities.Common.ValueObject;
using MediatR;

namespace Application.Features.ReferenceData.GetBank
{
    public sealed class Handler : IRequestHandler<Query, IReadOnlyList<Response>>
    {
        public Task<IReadOnlyList<Response>> Handle(Query request, CancellationToken _)
        {
            IReadOnlyList<Response> result = BankCode.List.Select(x => new Response(x.Value, x.Text)).ToList();

            return Task.FromResult(result);
        }
    }
}