package tagrepository

import tagdomain "legalgo-BE-go/internal/domain/tag"

func (a *accessor) GetIDsByCodes(codes []string) ([]string, error) {
	var tags []string

	if err := a.db.
		Model(&tagdomain.Tag{}).
		Select("id").Where("code IN ?", codes).
		Pluck("id", &tags).
		Error; err != nil {
		return nil, err
	}

	return tags, nil
}
