using System.Net;

namespace DSaC.Models.Internal
{
    public class ResponseModel
    {
        public string? ErrorText;

        public bool IsError => !string.IsNullOrEmpty(ErrorText);

        private int? _errorCode = 200;

        public int? ErrorCode
        {
            get => _errorCode; 
            set => _errorCode = value;
        }

        public HttpStatusCode? StatusCode
        {
            get => (HttpStatusCode?)_errorCode;
            set => _errorCode = (int?)value;
        }
    }

    public class ResponseModel<T> : ResponseModel 
    {
        public T? Value { get; set; }
    }
}
