using PARR.API.Services.Interfaces;

namespace PARR.API.Services.Implementations
{
    public class UriService : IUriService
    {
        private readonly string baseUri;

        public UriService(string baseUri)
        {
            this.baseUri = baseUri;
        }

        public Uri GetAllUri(string apiRoutesGetAll)
        {
            return new Uri(baseUri + apiRoutesGetAll);
        }

        public Uri GetUri(string apiRoutesGet, string apiRoutesGetParam, string value)
        {
            var modifiedUri = apiRoutesGet.Replace(apiRoutesGetParam, value);
            return new Uri(baseUri + modifiedUri);
        }

        public Uri GetUri(string apiRoutesGet, string apiRoutesGetParam, Guid value)
        {
            return GetUri(apiRoutesGet, apiRoutesGetParam, value.ToString());
        }

        public Uri GetBaseUri()
        {
            return new Uri(baseUri);
        }
    }
}
