using Hcs.Broker.Api;
using Hcs.Broker.Api.Request;
using Hcs.Service.Async.NsiCommon;

namespace Hcs.Broker.Mock.Api
{
    /// <inheritdoc cref="INsiCommonApi"/>
    public class MockNsiCommonApi : INsiCommonApi
    {
        /// <inheritdoc cref="INsiCommonApi"/>
        public async Task<NsiItemType> ExportNsiItemAsync(int registryNumber, ListGroup listGroup, CancellationToken token = default)
        {
            await Task.Delay(3000, token);

            return null;
        }

        /// <inheritdoc cref="INsiCommonApi"/>
        public async Task<NsiListType> ExportNsiListAsync(ListGroup listGroup, CancellationToken token = default)
        {
            await Task.Delay(3000, token);

            return null;
        }

        public async Task<string> RequestExportNsiItemAsync(int registryNumber, ListGroup listGroup, CancellationToken token = default)
        {
            await Task.Delay(3000, token);

            return Guid.NewGuid().ToString();
        }

        public async Task<RequestSingleResult<NsiItemType>> GetExportNsiItemResultAsync(string messageGuid)
        {
            await Task.Delay(3000);

            return new RequestSingleResult<NsiItemType>()
            {
                Ready = false
            };
        }
    }
}
