Add beneficiaries informations to bookings list
Some checks failed
Build and Push Docker Image / build_and_push (push) Failing after 1m25s

This commit is contained in:
2024-11-19 15:53:40 +01:00
parent 2f760733af
commit 5f12bed2d4
3 changed files with 29 additions and 6 deletions

View File

@@ -42,6 +42,22 @@ func (s *ServicesHandler) GetBeneficiaries() (accounts []storage.Account, err er
return
}
func (s *ServicesHandler) GetBeneficiariesMap() (accounts map[string]storage.Account, err error) {
accounts = map[string]storage.Account{}
request := &mobilityaccounts.GetAccountsRequest{
Namespaces: []string{"parcoursmob_beneficiaries"},
}
resp, err := s.GRPC.MobilityAccounts.GetAccounts(context.TODO(), request)
if err == nil {
for _, v := range resp.Accounts {
accounts[v.Id] = v.ToStorageType()
}
}
return
}
func (s *ServicesHandler) GetAccounts() (accounts []storage.Account, err error) {
accounts = []storage.Account{}
request := &mobilityaccounts.GetAccountsRequest{