package tools

import (
	"amocrm/internal/models"
	"penahub.gitlab.yandexcloud.net/backend/quiz/common.git/model"
)

func ConvertUserGroups(groups *models.AmocrmUserInformation) []model.UserGroups {
	var userGroups []model.UserGroups
	for _, group := range groups.Embedded.UsersGroups {
		userGroups = append(userGroups, model.UserGroups{
			ID:   group.ID,
			Name: group.Name,
			UUID: group.UUID,
		})
	}
	return userGroups
}

//func ConvertGroups(groups models.Users) []model.UserGroups {
//	var userGroups []model.UserGroups
//	for _, group := range groups.Embedded.Groups {
//		userGroups = append(userGroups, model.UserGroups{
//			ID:   group.ID,
//			Name: group.Name,
//		})
//	}
//	return userGroups
//}
