//go:generate ${GOBIN}/dummygen -d=api_dummy.go -package=api ${GO_MODULE}/pkg/service/jira/api JiraServiceAPI
//go:generate ${GOBIN}/mockgen -destination=jira_service_api_mock.go -package=api ${GO_MODULE}/pkg/service/jira/api JiraServiceAPI
package api

import (
	"context"

	jiraent "github.com/tidbcloud/devops/entity/jira"
)

type ListAlertsParam struct {
	Filter    ListAlertsFilter
	Search    string
	PageToken string
	PageSize  int
}

type ListAlertsFilter struct {
	Type      string
	ClusterID uint64
	StartTs   int64
	EndTs     int64
	Recovered *bool
	Priority  []string
}

type ListAlertsResult struct {
	Alerts        []*jiraent.Alert
	IsLast        bool
	NextPageToken string
}

type GetAlertsSummaryParam struct {
	ClusterID uint64
	StartTs   int64
	EndTs     int64
}

type AlertServiceAPI interface {
	ListAlerts(ctx context.Context, param ListAlertsParam) (*ListAlertsResult, error)
	GetAlertSummary(ctx context.Context, param GetAlertsSummaryParam) (*jiraent.AlertSummary, error)
}

type JiraServiceAPI interface {
	AlertServiceAPI
	IssueServiceAPI
}
