using Application.Abstractions.Messaging;
﻿using Domain.Entities.Common.ValueObject;

namespace Application.Features.Admin.ReferenceData.GetBank
{
    public sealed class Handler : IQueryHandler<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);
        }
    }
}