package common

import (
	"context"
)

// RouteInfo represents unified route information across cloud providers.
// This abstraction allows us to work with routes from different providers
// (AWS Route, AliCloud RouteEntry) in a uniform way.
type RouteInfo struct {
	// Name is the Kubernetes CR name of the route
	Name string

	// RouteTableName is the Kubernetes CR name of the route table this route belongs to
	RouteTableName string

	// State represents the cloud-specific route state
	// AWS: "active", "blackhole", etc.
	// AliCloud: empty (not applicable)
	State string

	// IsReady indicates whether the Crossplane Route CR is synced and ready
	IsReady bool
}

// RouteManager defines operations for managing VPC peering routes.
// Each cloud provider should implement this interface to provide
// a unified way of managing routes across different clouds.
type RouteManager interface {
	// ListRoutes returns all routes associated with the specified VPC peering.
	// The vpcPeeringName is used to filter routes by label.
	//
	// Returns:
	//   - A slice of RouteInfo containing route details
	//   - An error if the list operation fails
	ListRoutes(ctx context.Context, vpcPeeringName string) ([]RouteInfo, error)

	// DeleteRoute deletes a single route CR.
	// The route parameter provides the information needed to identify and delete the route.
	//
	// Returns:
	//   - An error if the delete operation fails
	//   - NotFound errors should be ignored (idempotent deletion)
	DeleteRoute(ctx context.Context, route RouteInfo) error
}
