package publish

import (
	"context"
	"fmt"

	"apps/backend/internal/module/studio/domain"
)

// UnavailableTransport is a deliberate non-success path for deployments that
// have not configured Threads. It replaces the old successful fake transport.
type UnavailableTransport struct {
	reason string
}

func NewUnavailable(reason string) *UnavailableTransport {
	return &UnavailableTransport{reason: reason}
}

func (t *UnavailableTransport) Publish(context.Context, domain.PublishRequest) (*domain.PublishResult, error) {
	return nil, fmt.Errorf("Threads publishing is not configured: %s", t.reason)
}

var _ Transport = (*UnavailableTransport)(nil)
