package schedule

import (
	"context"

	"github.com/tidbcloud/AgentTeam/internal/schedule/manage"
)

// Service is the canonical schedule management port used by /api/v1/workspaces/:workspaceId/schedules routes.
type Service interface {
	ListSchedulesForOwnerWithFilter(ctx context.Context, ownerUserID string, workspaceID string, filter manage.ListFilter) ([]manage.ScheduleView, error)
	ValidateScheduleForOwner(ctx context.Context, ownerUserID string, workspaceID string, input manage.UpsertInput, existingScheduleID string) (manage.ScheduleValidateResult, error)
	CreateScheduleForOwner(ctx context.Context, ownerUserID string, workspaceID string, input manage.UpsertInput) (manage.ScheduleView, error)
	GetScheduleForOwner(ctx context.Context, ownerUserID string, workspaceID string, scheduleID string) (manage.ScheduleView, error)
	UpdateScheduleForOwner(ctx context.Context, ownerUserID string, workspaceID string, scheduleID string, input manage.UpsertInput) (manage.ScheduleView, error)
	PauseScheduleForOwner(ctx context.Context, ownerUserID string, workspaceID string, scheduleID string) (manage.ScheduleView, error)
	ResumeScheduleForOwner(ctx context.Context, ownerUserID string, workspaceID string, scheduleID string) (manage.ScheduleView, error)
	DeleteScheduleForOwner(ctx context.Context, ownerUserID string, workspaceID string, scheduleID string) error
	ListAutomationRunsForScheduleOwner(ctx context.Context, ownerUserID string, workspaceID string, scheduleID string, limit int) ([]manage.AutomationRunView, error)
}
