namespace DocuMed.PWA.Models.Api;

public class ApiResult(bool isSuccess, ApiResultStatusCode statusCode, string message = null)
{
    public bool IsSuccess { get; set; } = isSuccess;
    public ApiResultStatusCode StatusCode { get; set; } = statusCode;

    public string Message { get; set; } = message ?? statusCode.ToDisplay();
}

public class ApiResult<TData>(bool isSuccess, ApiResultStatusCode statusCode, TData data, string message = null)
    : ApiResult(isSuccess, statusCode, message)
    where TData : class
{
    public TData Data { get; set; } = data;
}