package handler

import (
	"context"
	"solidarity-service/models"
	"git.coopgo.io/coopgo-platform/mobility-accounts/grpcapi"
)

func (h *SolidarityServiceHandler) GetAccountInfos(ctx context.Context, id string) (account *models.Account, err error) {
	resp, err := h.Services.MobilityAccounts.Client.GetAccount(ctx, &grpcapi.GetAccountRequest{Id: id})
	if err != nil {
		return nil, err
	}
	account = h.Services.MobilityAccounts.ToAccountModel(resp.Account.ToStorageType())
	return account, nil
}
