1

change create group event + new group fields

This commit is contained in:
Christoph
2020-03-11 15:27:56 +01:00
parent aaa3437eed
commit e8770066f8
2 changed files with 16 additions and 12 deletions

View File

@ -19,15 +19,20 @@ public class Group extends Aggregate {
private final List<User> members;
private final Map<User, Role> roles;
private GroupType type;
private Visibility visibility;
private Long parent;
public Group() {
this.members = new ArrayList<>();
this.roles = new HashMap<>();
}
private void applyEvent(CreateGroupEvent event) {
title = event.getGroupTitle();
description = event.getGroupDescription();
id = event.getGroup_id();
visibility = event.getGroupVisibility();
parent = event.getGroupParent();
type = event.getGroupType();
}
private void applyEvent(UpdateRoleEvent event) throws UserNotFoundException {

View File

@ -3,22 +3,21 @@ package mops.gruppen2.domain.event;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import mops.gruppen2.domain.GroupType;
import mops.gruppen2.domain.Visibility;
@Getter
@AllArgsConstructor
@NoArgsConstructor
public class CreateGroupEvent extends Event {
String groupTitle;
String groupDescription;
private Visibility groupVisibility;
private Long groupParent;
private GroupType groupType;
public CreateGroupEvent(long event_id, Long group_id, String user_id, String groupTitle, String groupDescription) {
super(event_id, group_id, user_id);
this.groupTitle = groupTitle;
this.groupDescription = groupDescription;
}
public CreateGroupEvent(Long group_id, String user_id, String groupTitle, String groupDescription) {
public CreateGroupEvent(Long group_id, String user_id, Long parent, GroupType type, Visibility visibility) {
super(group_id, user_id);
this.groupTitle = groupTitle;
this.groupDescription = groupDescription;
this.groupParent = parent;
this.groupType = type;
this.groupVisibility = visibility;
}
}