#nullable disable
namespace Marco.Pms.Model.Utilities
{
 
        public class ApiResponse<T>
        {
            public bool Success { get; set; }
            public string Message { get; set; }
            public T Data { get; set; }
            public object Errors { get; set; }
            public int StatusCode { get; set; }
            public DateTime Timestamp { get; set; } = DateTime.UtcNow;

            public ApiResponse(bool success, string message, T data, object errors, int statusCode)
            {
                Success = success;
                Message = message;
                Data = data;
                Errors = errors;
                StatusCode = statusCode;
            }

            public static ApiResponse<T> SuccessResponse(T data, string message = "Request processed successfully.", int statusCode = 200)
            {
                return new ApiResponse<T>(true, message, data, null, statusCode);
            }

            public static ApiResponse<T> ErrorResponse(string message, object errors = null, int statusCode = 400)
            {
                return new ApiResponse<T>(false, message, default, errors, statusCode);
            }
        
    }

}
