using Facility.Core;
using Microsoft.AspNetCore.Mvc;
using OapApi.v1.Client;

namespace OapApi.v1;

public sealed class OapApiV1 : IOapApiV1
{
	public OapApiV1()
	{

	}

	public Task<ServiceResult<CreateApplicationResponseDto>> CreateApplicationAsync(CreateApplicationRequestDto request, CancellationToken cancellationToken = default)
	{
		return Task.FromResult(ServiceResult.Success(new CreateApplicationResponseDto
		{
			Application = new ApplicationDto
			{
				Id = "-1",
				Status = ApplicationStatus.InProgress,
				Terms = new ApplicationTermsDto
				{
					HasReadInstructions = request.ApplicationCreateSet.Terms.HasReadInstructions,
				}
			}
		}));
	}

	public Task<ServiceResult<GetApplicationResponseDto>> GetApplicationAsync(GetApplicationRequestDto request, CancellationToken cancellationToken = default)
	{
		return Task.FromResult(ServiceResult.Success(new GetApplicationResponseDto
		{
			Application = new ApplicationDto
			{
				Id = "1",
				Status = ApplicationStatus.InProgress,
				Terms = new ApplicationTermsDto
				{
					HasReadInstructions = true,
				}
			}
		}));
	}

	public Task<ServiceResult<GetApplicationsResponseDto>> GetApplicationsAsync(GetApplicationsRequestDto request, CancellationToken cancellationToken = default) => throw new NotImplementedException();

	public Task<ServiceResult<UpdateApplicationResponseDto>> UpdateApplicationAsync(UpdateApplicationRequestDto request, CancellationToken cancellationToken = default) => throw new NotImplementedException();
}
