package types

// QuoteExecutionReadiness classifies whether execution is immediately possible.
type QuoteExecutionReadiness string

const (
	QuoteExecutionReadinessUnspecified         QuoteExecutionReadiness = "unspecified"
	QuoteExecutionReadinessLiquidityReady      QuoteExecutionReadiness = "liquidity_ready"
	QuoteExecutionReadinessLiquidityObtainable QuoteExecutionReadiness = "liquidity_obtainable"
	QuoteExecutionReadinessIndicative          QuoteExecutionReadiness = "indicative"
)

type QuoteRouteHopRole string

const (
	QuoteRouteHopRoleUnspecified QuoteRouteHopRole = "unspecified"
	QuoteRouteHopRoleSource      QuoteRouteHopRole = "source"
	QuoteRouteHopRoleTransit     QuoteRouteHopRole = "transit"
	QuoteRouteHopRoleDestination QuoteRouteHopRole = "destination"
)

type QuoteRouteHop struct {
	Index      uint32            `bson:"index,omitempty" json:"index,omitempty"`
	Rail       string            `bson:"rail,omitempty" json:"rail,omitempty"`
	Gateway    string            `bson:"gateway,omitempty" json:"gateway,omitempty"`
	InstanceID string            `bson:"instanceId,omitempty" json:"instanceId,omitempty"`
	Network    string            `bson:"network,omitempty" json:"network,omitempty"`
	Role       QuoteRouteHopRole `bson:"role,omitempty" json:"role,omitempty"`
}

type QuoteRouteSettlement struct {
	Asset *Asset `bson:"asset,omitempty" json:"asset,omitempty"`
	Model string `bson:"model,omitempty" json:"model,omitempty"`
}

// QuoteRouteSpecification is an abstract route selected during quotation.
// It intentionally omits execution steps/operations.
type QuoteRouteSpecification struct {
	Rail              string                `bson:"rail,omitempty" json:"rail,omitempty"`
	Provider          string                `bson:"provider,omitempty" json:"provider,omitempty"`
	PayoutMethod      string                `bson:"payoutMethod,omitempty" json:"payoutMethod,omitempty"`
	Settlement        *QuoteRouteSettlement `bson:"settlement,omitempty" json:"settlement,omitempty"`
	Network           string                `bson:"network,omitempty" json:"network,omitempty"`
	RouteRef          string                `bson:"routeRef,omitempty" json:"routeRef,omitempty"`
	PricingProfileRef string                `bson:"pricingProfileRef,omitempty" json:"pricingProfileRef,omitempty"`
	Hops              []*QuoteRouteHop      `bson:"hops,omitempty" json:"hops,omitempty"`
}

// QuoteExecutionConditions stores quotation-time assumptions and constraints.
type QuoteExecutionConditions struct {
	Readiness                         QuoteExecutionReadiness `bson:"readiness,omitempty" json:"readiness,omitempty"`
	BatchingEligible                  bool                    `bson:"batchingEligible,omitempty" json:"batchingEligible,omitempty"`
	PrefundingRequired                bool                    `bson:"prefundingRequired,omitempty" json:"prefundingRequired,omitempty"`
	PrefundingCostIncluded            bool                    `bson:"prefundingCostIncluded,omitempty" json:"prefundingCostIncluded,omitempty"`
	LiquidityCheckRequiredAtExecution bool                    `bson:"liquidityCheckRequiredAtExecution,omitempty" json:"liquidityCheckRequiredAtExecution,omitempty"`
	LatencyHint                       string                  `bson:"latencyHint,omitempty" json:"latencyHint,omitempty"`
	Assumptions                       []string                `bson:"assumptions,omitempty" json:"assumptions,omitempty"`
}
