// Package mongotest provides mock implementations for testing MongoDB functionality
package mongotest

import (
	"context"
	"fmt"

	"github.com/pfeifferj/container-mom-go/pkg/operator/mongodb/api"
	"go.mongodb.org/mongo-driver/mongo"
)

var _ api.Interface = (*ErrorMockClient)(nil)

// ErrorMockClient simulates MongoDB errors
type ErrorMockClient struct{}

func NewErrorMockClient() *ErrorMockClient {
	return &ErrorMockClient{}
}

func (m *ErrorMockClient) ListDeployments(_ context.Context) ([]api.MongoDeployment, error) {
	return nil, fmt.Errorf("failed to query deployments: simulated error")
}

func (m *ErrorMockClient) GetDeployment(_ context.Context, _ string) (*api.MongoDeployment, error) {
	return nil, fmt.Errorf("failed to get deployment: simulated error")
}

func (m *ErrorMockClient) CreateDeployment(_ context.Context, _ *api.MongoDeployment) error {
	return fmt.Errorf("failed to create deployment: simulated error")
}

func (m *ErrorMockClient) UpdateDeployment(_ context.Context, _ *api.MongoDeployment) error {
	return fmt.Errorf("failed to update deployment: simulated error")
}

func (m *ErrorMockClient) DeleteDeployment(_ context.Context, _ string) error {
	return fmt.Errorf("failed to delete deployment: simulated error")
}

func (m *ErrorMockClient) DeleteAllDeployments(_ context.Context) error {
	return fmt.Errorf("failed to delete all deployments: simulated error")
}

func (m *ErrorMockClient) GetClient() *mongo.Client {
	return nil
}

func (m *ErrorMockClient) Disconnect(_ context.Context) error {
	return fmt.Errorf("failed to disconnect: simulated error")
}

func (m *ErrorMockClient) Database(_ string) *mongo.Database {
	return nil
}
