fix: User checks (#139)

* check uniqueness on create and register user

* change user email, reserve release unique email

* usergrant unique aggregate

* usergrant uniqueness

* validate UserGrant

* fix tests
This commit is contained in:
Fabi
2020-05-28 06:49:22 +02:00
committed by GitHub
parent 71626f25f3
commit d447f68d78
19 changed files with 453 additions and 129 deletions

View File

@@ -29,12 +29,12 @@ func (repo *OrgRepo) SetUpOrg(ctx context.Context, setUp *admin_model.SetupOrg)
return nil, err
}
user, userAggregate, err := repo.UserEventstore.PrepareCreateUser(ctx, setUp.User, org.AggregateID)
user, userAggregates, err := repo.UserEventstore.PrepareCreateUser(ctx, setUp.User, org.AggregateID)
if err != nil {
return nil, err
}
aggregates = append(aggregates, userAggregate)
aggregates = append(aggregates, userAggregates...)
setupModel := &Setup{Org: org, User: user}
member := org_model.NewOrgMemberWithRoles(org.AggregateID, user.AggregateID, "ORG_ADMIN") //TODO: role as const