You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My understanding of this is still a bit fuzzy, so sorry if I'm being confused. But, where should the repository method for adding a relationship belongs? For example, there's this domain logic:
this.assertArgumentNotNull(aUser, "User must not be null.");
this.assertArgumentEquals(this.tenantId(), aUser.tenantId(), "Wrong tenant for this group.");
this.assertArgumentTrue(aUser.isEnabled(), "User is not enabled.");
if (this.groupMembers().add(aUser.toGroupMember()) && !this.isInternalGroup()) {
DomainEventPublisher
.instance()
.publish(newGroupUserAdded(
this.tenantId(),
this.name(),
aUser.username()));
}
}
But it looks like the handler for the GroupUserAdded event is not implemented yet. But if you want to persist the fact that this user is added to the group (as a group member), where would you put that method?
Would it be in the GroupRepository or UserRepository? Or maybe a new repository (e.g. GroupMemberRepository)?
The text was updated successfully, but these errors were encountered:
My understanding of this is still a bit fuzzy, so sorry if I'm being confused. But, where should the repository method for adding a relationship belongs? For example, there's this domain logic:
IDDD_Samples/iddd_identityaccess/src/main/java/com/saasovation/identityaccess/domain/model/identity/Group.java
Lines 58 to 71 in 9b27b11
But it looks like the handler for the
GroupUserAdded
event is not implemented yet. But if you want to persist the fact that this user is added to the group (as a group member), where would you put that method?Would it be in the
GroupRepository
orUserRepository
? Or maybe a new repository (e.g.GroupMemberRepository
)?The text was updated successfully, but these errors were encountered: