package dbc

import (
	fm29_frs90 "github.com/fiskerinc/cloud-services/pkg/dbc/fm29_frs90"
	fm29_frsd0 "github.com/fiskerinc/cloud-services/pkg/dbc/fm29_frsd0"
	fm29_frsd21 "github.com/fiskerinc/cloud-services/pkg/dbc/fm29_frsd21"
	fm29_frsd390 "github.com/fiskerinc/cloud-services/pkg/dbc/fm29_frsd390"
	"github.com/fiskerinc/cloud-services/pkg/dbc/models"
)

// This is the DBC hash before frsd0 was fixed
var fm29_frsd0aHash = "73583d63735b404f5209a71107c3d2174b0ab1ba40bd826b8cb69668598b0395"

func NewDBCCollection() models.DBCCollectionInterface {
	return models.NewDBCCollection(nil).
		AddVersion(fm29_frsd21.Hash, NewFM29_FRSD21_DBC()).
		AddVersion(fm29_frsd0.Hash, NewFM29_FRSD0_DBC()).
		AddVersion(fm29_frsd0aHash, NewFM29_FRSD0_DBC()).
		AddVersion(fm29_frs90.Hash, NewFM29_FRS90_DBC()).
		AddVersion(fm29_frsd390.Hash, NewFM29_FRSD390_DBC())
}

// NewDBCVersionsOnly is only used for version string key translations.
// if you need DBC parsing, use NewDBCCollection.
func NewDBCVersionsOnly() models.DBCCollectionInterface {
	return models.NewDBCCollection(nil).
		AddVersion(fm29_frsd21.Hash, &models.DBCVersion{}).
		AddVersion(fm29_frsd0.Hash, &models.DBCVersion{}).
		AddVersion(fm29_frsd0aHash, &models.DBCVersion{}).
		AddVersion(fm29_frs90.Hash, &models.DBCVersion{}).
		AddVersion(fm29_frsd390.Hash, &models.DBCVersion{})
}
