package crawler

import (
	"fmt"

	"github.com/maximotejeda/us_dop_scrapper/internal/ports"
)

func Selector(who string, client ports.DollarPort) (ports.APIPorts, error) {
	var parser ports.APIPorts
	switch who {
	case "apap":
		parser = NewApap(client)
	case "bcd":
		parser = NewBCD(client)
	case "bdr":
		parser = NewBDR(client)
	case "bhd":
		parser = NewBHD(client)
	case "bnc":
		parser = NewBNC(client)
	case "bpd":
		parser = NewBPD(client)
	case "inf":
		parser = NewINF(client)
	case "scotia":
		parser = NewScotia(client)
	case "vimenca":
		parser = NewVimenca(client)
	default:
		return nil, fmt.Errorf("not recognize who: " + who)
	}
	return parser, nil
}
