package model

import (
	"context"
	"strings"
)

type Driver string

const (
	DriverBinance   Driver = "BINANCE"
	DriverCoinGecko Driver = "COINGECKO"
	DriverCBR       Driver = "CBR"
)

func (d Driver) String() string {
	return string(d)
}

func (d Driver) IsEmpty() bool {
	return strings.TrimSpace(string(d)) == ""
}

func NormalizeDriver(d Driver) Driver {
	return Driver(strings.ToUpper(strings.TrimSpace(string(d))))
}

type Connector interface {
	ID() Driver
	FetchTicker(ctx context.Context, symbol string) (*Ticker, error)
}
