package metrics

import (
	"github.com/pingcap-inc/clinic/clinic_data_service/pkg/dto"
)

type ProjectInfo struct {
	ProjectName string        `json:"project_name"`
	Cluster     []dto.Cluster `json:"cluster"`
	DocumentID  string        `json:"document_module"`
	DashboardID string        `json:"dashboard_id"`
	BlockID     string        `json:"block_id"`
}

type ClusterTableData struct {
	ClusterName           string            `json:"cluster_name"`
	ResourceDetailData    []DetailTableData `json:"resource_table_data"`
	PerformanceDetailData []DetailTableData `json:"performance_table_data"`
}

type DetailTableData struct {
	RuleName            string                `json:"rule_name"`
	TableRowAggregation []TableRowAggregation `json:"table_row_aggregation"`
}

type TableRowAggregation struct {
	QueryName       string `json:"queryName"`
	TimeAggregation string `json:"timeAggregation"`
	Threshold       string `json:"threshold"`
	Status          string `json:"status"`
	Max             string `json:"max"`
	Avg             string `json:"avg"`
	PromSQL         string `json:"promSQL"`
	Link            string `json:"link"`
}

type DetailTable struct {
	Time             string             `json:"time"`
	ClusterTableData []ClusterTableData `json:"cluster_table_data"`
	DocumentId       string             `json:"document_id"`
}

type DashboardTable struct {
	ClusterName         string                `json:"cluster_name"`
	TableRowAggregation []TableRowAggregation `json:"table_row_aggregation"`
}

type FeishuMessageForMetricsResult struct {
	Topic           string           `json:"topic"`
	OrgName         string           `json:"org_name"`
	Yesterday       string           `json:"yesterday"`
	DashboardResult []DashboardTable `json:"dashboard_result"`
}
