Upstream sync

This commit is contained in:
Senad Uka
2018-05-30 08:45:32 +02:00
parent 756d84359d
commit f1ac874276
15 changed files with 306 additions and 200 deletions

View File

@@ -50,6 +50,7 @@ func (mapping *userMapping) ToUserModel(item entity.User) viewmodel.User {
Profiles: mapping.mapper.Profile.ToProfileModelSlice(item.Profiles),
Organizations: mapping.mapper.Organization.ToOrganizationModelSlice(item.Organizations),
Types: mapping.mapper.Organization.ToOrganizationTypeModelSlice(item.Types),
Type: &item.Type,
}
}
@@ -79,6 +80,12 @@ func (mapping *userMapping) ToUserEntity(item viewmodel.User) entity.User {
Types: mapping.mapper.Organization.ToOrganizationTypeEntitySlice(item.Types),
}
if item.Type == nil {
user.Type = "S"
} else {
user.Type = *item.Type
}
if user.Name == "" {
user.Name = fmt.Sprintf("%s %s", item.First, item.Last)
}