package orchestrator

import (
	"context"

	"github.com/tech/sendico/payments/orchestrator/storage/model"
	orchestratorv1 "github.com/tech/sendico/pkg/proto/payments/orchestrator/v1"
)

// RouteStore exposes routing definitions for plan construction.
type RouteStore interface {
	List(ctx context.Context, filter *model.PaymentRouteFilter) (*model.PaymentRouteList, error)
}

// PlanTemplateStore exposes orchestration plan templates for plan construction.
type PlanTemplateStore interface {
	List(ctx context.Context, filter *model.PaymentPlanTemplateFilter) (*model.PaymentPlanTemplateList, error)
}

// GatewayRegistry exposes gateway instances for capability-based selection.
type GatewayRegistry interface {
	List(ctx context.Context) ([]*model.GatewayInstanceDescriptor, error)
}

// PlanBuilder constructs ordered payment plans from intents, quotes, and routing policy.
type PlanBuilder interface {
	Build(ctx context.Context, payment *model.Payment, quote *orchestratorv1.PaymentQuote, routes RouteStore, templates PlanTemplateStore, gateways GatewayRegistry) (*model.PaymentPlan, error)
}
