package workspace

import (
	"github.com/tidbcloud/aisupport/packages/sdk-go/contracts/entity/base"
	collabent "github.com/tidbcloud/aisupport/packages/sdk-go/contracts/entity/ticket-manager/collaboration"
	ticketent "github.com/tidbcloud/aisupport/packages/sdk-go/contracts/entity/ticket-manager/ticket"
)

type IssueBinding struct {
	base.Base `json:",inline"`

	WorkspaceID uint64 `json:"workspace_id"`
	IssueKey    string `json:"issue_key"`
	BoundBy     string `json:"bound_by"`
}

type Issue struct {
	IssueBinding `json:",inline"`

	Issue *ticketent.JiraIssue `json:"issue,omitempty"` // maybe nil, set when caller needs
}

type AlertBinding struct {
	base.Base `json:",inline"`

	WorkspaceID uint64 `json:"workspace_id"`
	AlertKey    string `json:"alert_key"`
	BoundBy     string `json:"bound_by"`
}

type Alert struct {
	AlertBinding `json:",inline"`

	Alert *ticketent.JiraIssue `json:"alert,omitempty"` // maybe nil, set when caller needs
}

type TenantBinding struct {
	base.Base `json:",inline"`

	WorkspaceID  uint64 `json:"workspace_id"`
	TenantID     string `json:"tenant_id"`
	TenantName   string `json:"tenant_name"`
	TenantRegion string `json:"tenant_region"`
}

type ClusterBinding struct {
	base.Base `json:",inline"`

	WorkspaceID     uint64 `json:"workspace_id"`
	ClusterID       string `json:"cluster_id"`
	ClusterName     string `json:"cluster_name"`
	ClusterType     string `json:"cluster_type"`
	ClusterProvider string `json:"cluster_provider"`
	ClusterRegion   string `json:"cluster_region"`
}

type CollaborationResourceBinding struct {
	base.Base `json:",inline"`

	WorkspaceID uint64 `json:"workspace_id"`
	ResourceID  uint64 `json:"resource_id"`
	BoundBy     string `json:"bound_by"`
}

type CollaborationResource struct {
	CollaborationResourceBinding `json:",inline"`

	CollaborationResource *collabent.Resource `json:"collaboration_resource,omitempty"` // maybe nil, set when caller needs
}
