package services

import (
	"sync"

	"github.com/fiskerinc/cloud-services/pkg/dbc"
	"github.com/fiskerinc/cloud-services/pkg/dbc/models"
	"github.com/fiskerinc/cloud-services/pkg/can-go/pkg/descriptor"
)

var model models.DBCVersionInterface
var collectionOnce sync.Once

// GetDBCCollection returns singleton instance of collection of DBCs
func GetDBC() *descriptor.Database {
	collectionOnce.Do(func() {
		model = dbc.NewFM29_FRSD390_DBC()
	})
	return model.GetDatabase()
}
