package client

import (
	"context"

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

// Fake implements Client for tests.
type Fake struct {
	QuotePaymentFn           func(ctx context.Context, req *orchestratorv1.QuotePaymentRequest) (*orchestratorv1.QuotePaymentResponse, error)
	QuotePaymentsFn          func(ctx context.Context, req *orchestratorv1.QuotePaymentsRequest) (*orchestratorv1.QuotePaymentsResponse, error)
	InitiatePaymentsFn       func(ctx context.Context, req *orchestratorv1.InitiatePaymentsRequest) (*orchestratorv1.InitiatePaymentsResponse, error)
	InitiatePaymentFn        func(ctx context.Context, req *orchestratorv1.InitiatePaymentRequest) (*orchestratorv1.InitiatePaymentResponse, error)
	CancelPaymentFn          func(ctx context.Context, req *orchestratorv1.CancelPaymentRequest) (*orchestratorv1.CancelPaymentResponse, error)
	GetPaymentFn             func(ctx context.Context, req *orchestratorv1.GetPaymentRequest) (*orchestratorv1.GetPaymentResponse, error)
	ListPaymentsFn           func(ctx context.Context, req *orchestratorv1.ListPaymentsRequest) (*orchestratorv1.ListPaymentsResponse, error)
	InitiateConversionFn     func(ctx context.Context, req *orchestratorv1.InitiateConversionRequest) (*orchestratorv1.InitiateConversionResponse, error)
	ProcessTransferUpdateFn  func(ctx context.Context, req *orchestratorv1.ProcessTransferUpdateRequest) (*orchestratorv1.ProcessTransferUpdateResponse, error)
	ProcessDepositObservedFn func(ctx context.Context, req *orchestratorv1.ProcessDepositObservedRequest) (*orchestratorv1.ProcessDepositObservedResponse, error)
	CloseFn                  func() error
}

func (f *Fake) QuotePayment(ctx context.Context, req *orchestratorv1.QuotePaymentRequest) (*orchestratorv1.QuotePaymentResponse, error) {
	if f.QuotePaymentFn != nil {
		return f.QuotePaymentFn(ctx, req)
	}
	return &orchestratorv1.QuotePaymentResponse{}, nil
}

func (f *Fake) QuotePayments(ctx context.Context, req *orchestratorv1.QuotePaymentsRequest) (*orchestratorv1.QuotePaymentsResponse, error) {
	if f.QuotePaymentsFn != nil {
		return f.QuotePaymentsFn(ctx, req)
	}
	return &orchestratorv1.QuotePaymentsResponse{}, nil
}

func (f *Fake) InitiatePayments(ctx context.Context, req *orchestratorv1.InitiatePaymentsRequest) (*orchestratorv1.InitiatePaymentsResponse, error) {
	if f.InitiatePaymentsFn != nil {
		return f.InitiatePaymentsFn(ctx, req)
	}
	return &orchestratorv1.InitiatePaymentsResponse{}, nil
}

func (f *Fake) InitiatePayment(ctx context.Context, req *orchestratorv1.InitiatePaymentRequest) (*orchestratorv1.InitiatePaymentResponse, error) {
	if f.InitiatePaymentFn != nil {
		return f.InitiatePaymentFn(ctx, req)
	}
	return &orchestratorv1.InitiatePaymentResponse{}, nil
}

func (f *Fake) CancelPayment(ctx context.Context, req *orchestratorv1.CancelPaymentRequest) (*orchestratorv1.CancelPaymentResponse, error) {
	if f.CancelPaymentFn != nil {
		return f.CancelPaymentFn(ctx, req)
	}
	return &orchestratorv1.CancelPaymentResponse{}, nil
}

func (f *Fake) GetPayment(ctx context.Context, req *orchestratorv1.GetPaymentRequest) (*orchestratorv1.GetPaymentResponse, error) {
	if f.GetPaymentFn != nil {
		return f.GetPaymentFn(ctx, req)
	}
	return &orchestratorv1.GetPaymentResponse{}, nil
}

func (f *Fake) ListPayments(ctx context.Context, req *orchestratorv1.ListPaymentsRequest) (*orchestratorv1.ListPaymentsResponse, error) {
	if f.ListPaymentsFn != nil {
		return f.ListPaymentsFn(ctx, req)
	}
	return &orchestratorv1.ListPaymentsResponse{}, nil
}

func (f *Fake) InitiateConversion(ctx context.Context, req *orchestratorv1.InitiateConversionRequest) (*orchestratorv1.InitiateConversionResponse, error) {
	if f.InitiateConversionFn != nil {
		return f.InitiateConversionFn(ctx, req)
	}
	return &orchestratorv1.InitiateConversionResponse{}, nil
}

func (f *Fake) ProcessTransferUpdate(ctx context.Context, req *orchestratorv1.ProcessTransferUpdateRequest) (*orchestratorv1.ProcessTransferUpdateResponse, error) {
	if f.ProcessTransferUpdateFn != nil {
		return f.ProcessTransferUpdateFn(ctx, req)
	}
	return &orchestratorv1.ProcessTransferUpdateResponse{}, nil
}

func (f *Fake) ProcessDepositObserved(ctx context.Context, req *orchestratorv1.ProcessDepositObservedRequest) (*orchestratorv1.ProcessDepositObservedResponse, error) {
	if f.ProcessDepositObservedFn != nil {
		return f.ProcessDepositObservedFn(ctx, req)
	}
	return &orchestratorv1.ProcessDepositObservedResponse{}, nil
}

func (f *Fake) Close() error {
	if f.CloseFn != nil {
		return f.CloseFn()
	}
	return nil
}
