package handler

import (
	"net/http"

	"github.com/labstack/echo/v4"

	"github.com/pingcap/test-infra/common/model"
	"github.com/pingcap/test-infra/services/tcms/utils"
)

// GetRemoteConfigs ...
// @Summary Get configs like supported execution fail reasons.
// @ID get-remote-configs
// @Tags config
// @Success 200 {object} map[string]interface{}
// @Failure default {object} HTTPError
// @Router /config [get]
func (h *HTTPHandler) GetRemoteConfigs(c echo.Context) error {
	ctx := c.(utils.Context)
	return ctx.JSON(http.StatusOK, echo.Map{
		"execReasonList": model.ReasonList,
		"reasonList":     model.CaseExecFailReasonCase.Values(),
		"solutionList":   model.ExecFailSolutionKEEP.Values(),
	})
}
