package repository

import (
	"context"

	"github.com/ocdp/cluster-service/internal/domain/entity"
)

type WorkspaceRepository interface {
	Create(ctx context.Context, workspace *entity.Workspace) error
	GetByID(ctx context.Context, id string) (*entity.Workspace, error)
	GetByName(ctx context.Context, name string) (*entity.Workspace, error)
	Update(ctx context.Context, workspace *entity.Workspace) error
	Delete(ctx context.Context, id string) error
	List(ctx context.Context) ([]*entity.Workspace, error)
}

type WorkspaceClusterBindingRepository interface {
	Upsert(ctx context.Context, binding *entity.WorkspaceClusterBinding) error
	Get(ctx context.Context, workspaceID, clusterID string) (*entity.WorkspaceClusterBinding, error)
	ListByWorkspace(ctx context.Context, workspaceID string) ([]*entity.WorkspaceClusterBinding, error)
	Delete(ctx context.Context, workspaceID, clusterID string) error
}

type AuditLogRepository interface {
	Create(ctx context.Context, log *entity.AuditLog) error
	ListByWorkspace(ctx context.Context, workspaceID string, limit int) ([]*entity.AuditLog, error)
}
