Upstream sync
This commit is contained in:
@@ -217,7 +217,7 @@ func (s *organizationService) AddOrganization(organization viewmodel.Organizatio
|
||||
address := entity.OrganizationAddress{
|
||||
InternalID: provider.MukID,
|
||||
Name: "Main Address",
|
||||
Address: fmt.Sprintf("%s %s - %s, %s (%s)", provider.StreetName1, provider.StreetName2, provider.CityName, provider.State, provider.ZipCode),
|
||||
Address: fmt.Sprintf("%s %s - %s, %s (%s)", provider.StreetName1, provider.StreetName2, provider.CityName, provider.State, provider.ZipCode[:5]),
|
||||
Latitude: lat,
|
||||
Longitude: long,
|
||||
CreatedUser: enOrg.Author,
|
||||
@@ -248,5 +248,5 @@ func (s *organizationService) AddOrganization(organization viewmodel.Organizatio
|
||||
return viewmodel.Organization{}, nil
|
||||
}
|
||||
|
||||
return s.GetByUUID(enOrg.UUID, user)
|
||||
return s.mapEntity.Organization.ToOrganizationModel(enOrg), nil
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package applicationservice
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"bitbucket.org/nemt/nemt-portal-api/application/entitymapping"
|
||||
"bitbucket.org/nemt/nemt-portal-api/application/viewmodel"
|
||||
"bitbucket.org/nemt/nemt-portal-api/domain/service"
|
||||
@@ -27,6 +29,8 @@ func (s *visitService) Save(visit viewmodel.Visit) (viewmodel.Visit, error) {
|
||||
if a.AddressType == "home" {
|
||||
address, err := s.svc.Users.GetAddressByUUID(a.UUID)
|
||||
if err != nil {
|
||||
fmt.Println("Application Visit: Address UUID: ", a.UUID)
|
||||
fmt.Println("Application Visit: Address Error: ", err.Error())
|
||||
return viewmodel.Visit{}, err
|
||||
}
|
||||
|
||||
@@ -41,12 +45,15 @@ func (s *visitService) Save(visit viewmodel.Visit) (viewmodel.Visit, error) {
|
||||
|
||||
provider, err := s.svc.Provider.GetByUUID(entity.Provider.ProviderUUID, entity.CreatedUser)
|
||||
if err != nil {
|
||||
fmt.Println("Application Visit: Provider UUID: ", entity.Provider.ProviderUUID)
|
||||
fmt.Println("Application Visit: Provider Error: ", err.Error())
|
||||
return viewmodel.Visit{}, errors.Wrap(err)
|
||||
}
|
||||
entity.Provider = provider
|
||||
|
||||
retVal, err := s.svc.Visits.Create(entity)
|
||||
if err != nil {
|
||||
fmt.Println("Application Visit: Create Visit Error: ", err.Error())
|
||||
return viewmodel.Visit{}, errors.Wrap(err)
|
||||
}
|
||||
|
||||
@@ -80,17 +87,20 @@ func (s *visitService) GetByUUID(visitUUID string, user viewmodel.User) (viewmod
|
||||
eUser := s.mapEntity.User.ToUserEntity(user)
|
||||
retVal, err := s.svc.Visits.GetByUUID(visitUUID, eUser)
|
||||
if err != nil {
|
||||
fmt.Println("Visit Application: Error getting visit: ", err.Error())
|
||||
return viewmodel.Visit{}, errors.Wrap(err)
|
||||
}
|
||||
|
||||
visitUser, err := s.svc.Users.GetByUUID(retVal.User.UUID, "US")
|
||||
if err != nil {
|
||||
fmt.Println("Visit Application: Error getting user: ", err.Error())
|
||||
return viewmodel.Visit{}, errors.Wrap(err)
|
||||
}
|
||||
retVal.User = visitUser
|
||||
|
||||
provider, err := s.svc.Provider.GetByUUID(retVal.Provider.ProviderUUID, eUser)
|
||||
if err != nil {
|
||||
fmt.Println("Visit Application: Error getting provider: ", err.Error())
|
||||
return viewmodel.Visit{}, errors.Wrap(err)
|
||||
}
|
||||
retVal.Provider = provider
|
||||
|
||||
Reference in New Issue
Block a user